[FFmpeg-devel] NC4600 camera code
nicolas martin
elvadrias
Sat Dec 13 19:56:09 CET 2008
> On Sat, Dec 13, 2008 at 12:21:52PM -0500, nicolas martin wrote:
>>>> +int nc4600_ident_packet(unsigned char *p)
>>>> +{
>>>> + int size=0;
>>>> + uint32_t *q = (uint32_t*)p;
>>>> + if (*q==0xA5010000) {
>>>> + size = p[5] + p[6]*256;
>>>> + }
>>>> + return size;
>>>> +}
>>
>> Well I agree on that one, but how am I supposed to get the fifth and
>> sixth byte of the buffer if I don't know if it really is the good one
>> (depending on endians ...).
>> Should I take the result of AV_RL32 as granted as it will give the
>> bytes in the order I want them to be ?
>
> I don't understand what you are asking.
> The corrected version of above function would be e.g.
>> if (AV_RL32(p) != 0xA5010000) return 0;
>> return AV_RL16(p + 5);
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
I made some changes in the comments and functions.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081213/8c8a568f/attachment.txt>
-------------- next part --------------
More information about the ffmpeg-devel
mailing list