Identify some values

This commit is contained in:
Florian Märkl 2019-06-10 11:14:37 +02:00
commit defa6d54df
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
2 changed files with 7 additions and 6 deletions

View file

@ -73,9 +73,9 @@ typedef struct chiaki_takion_av_packet_t
{
uint16_t packet_index;
uint16_t frame_index;
bool byte_at_0x1a;
bool uses_nalu_info_structs;
bool is_video;
uint16_t word_at_0xa;
uint16_t nalu_index;
uint16_t word_at_0xc;
uint16_t word_at_0xe;
uint32_t codec;

View file

@ -727,7 +727,7 @@ static void takion_handle_packet_av(ChiakiTakion *takion, uint8_t base_type, uin
ChiakiTakionAVPacket packet = {0};
packet.is_video = base_type == TAKION_PACKET_TYPE_VIDEO;
packet.byte_at_0x1a = ((buf[0] >> 4) & 1) != 0;
packet.uses_nalu_info_structs = ((buf[0] >> 4) & 1) != 0;
size_t av_header_size = packet.is_video ? AV_HEADER_SIZE_VIDEO : AV_HEADER_SIZE_AUDIO;
if(av_size < av_header_size + 1) // TODO: compare av_size or buf_size?
@ -744,13 +744,13 @@ static void takion_handle_packet_av(ChiakiTakion *takion, uint8_t base_type, uin
uint32_t dword_2 = ntohl(*((uint32_t *)(av + 4)));
if(packet.is_video)
{
packet.word_at_0xa = (uint16_t)((dword_2 >> 0x15) & 0x7ff);
packet.nalu_index = (uint16_t)((dword_2 >> 0x15) & 0x7ff);
packet.word_at_0xc = (uint16_t)(((dword_2 >> 0xa) & 0x7ff) + 1);
packet.word_at_0xe = (uint16_t)(dword_2 & 0x3ff);
}
else
{
packet.word_at_0xa = (uint16_t)((dword_2 >> 0x18) & 0xff);
packet.nalu_index = (uint16_t)((dword_2 >> 0x18) & 0xff);
packet.word_at_0xc = (uint16_t)(((dword_2 >> 0x10) & 0xff) + 1);
packet.word_at_0xe = (uint16_t)(dword_2 & 0xffff);
}
@ -774,7 +774,8 @@ static void takion_handle_packet_av(ChiakiTakion *takion, uint8_t base_type, uin
av_size -= 3;
}
// TODO: parsing for packet.byte_at_0x1a
// TODO: parsing for uses_nalu_info_structs (before: packet.byte_at_0x1a)
packet.uses_nalu_info_structs = true;
if(packet.is_video)
{