[FFmpeg-devel] NC4600 camera code

nicolas martin elvadrias
Thu Jan 8 23:50:58 CET 2009


> On Sat, Dec 13, 2008 at 09:28:44PM -0500, nicolas martin wrote:
>>> On Sat, Dec 13, 2008 at 01:56:09PM -0500, nicolas martin wrote:
>>>>> 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.
>>>>
>>>
>>> [...]
>>>> @@ -914,6 +957,20 @@
>>>> };
>>>> #endif
>>>>
>>>> +#ifdef CONFIG_NC4600_DEMUXER
>>>> +AVInputFormat nc4600_demuxer = {
>>>> +    "nc4600",
>>>> +    NULL_IF_CONFIG_SMALL("special raw MPEG-4 video format"),
>>>> +    0,
>>>
>>>> +    nc4600_mpeg4video_probe,
>>>> +    video_read_header,
>>>> +    nc4600_read_partial_packet,
>>>> +    .flags= AVFMT_GENERIC_INDEX,
>>>> +    .extensions = "nc4600", //FIXME remove after writing  
>>>> mpeg4_probe
>>>
>>> at the very least the comment is wrong
>>
>> This comment is a copy of the one found in the M4V demuxer ..
>
> thanks, ive just removed it from the m4v demuxer ...
>
>
>>
>>>
>>>
>>> also, what does this demuxer has to do with raw? if nothing then it
>>> does not
>>> belong in raw.c
>>
>> Actually I don't know, I'm not a ffmpeg developper at all ...
>> This is just the way I made it work.
>>
>> I need one of you that knows exactly the code tree to tell me where I
>> can insert myself ...
>
> pick a file name that is not in use yet in libavformat and that sounds
> similar to the format you try to implement, also make sure it ends  
> in .c
>
>
>>
>>>
>>>
>>>
>>> [...]
>>>> Index: libavformat/avio.h
>>>> ===================================================================
>>>> --- libavformat/avio.h	(revision 16101)
>>>> +++ libavformat/avio.h	(working copy)
>>> [...]
>>>> Index: libavformat/aviobuf.c
>>>> ===================================================================
>>>> --- libavformat/aviobuf.c	(revision 16101)
>>>> +++ libavformat/aviobuf.c	(working copy)
>>>
>>> all changes to these 2 files are rejected
>>> you first should explain why you would ave to change anything in
>>> them at all
>>
>> I changed those two files because this is the way I made it work.
>
>> Again, if I could put all my code in a separate file and expect  
>> ffmpeg
>> to find it and link proprely I would do it.
>
> http://wiki.multimedia.cx/index.php?title=FFmpeg_demuxer_howto
>
>


Hi there,

It's been a long time, but I have been working on my demuxer for my  
cameras.

I put all my code in a separate file.
However I have  a problem.
I've seen that you can have a private structure in the priv_data field  
of an AVFormatContext.
So I put all my private fields here.

But I have to modify the standard get_partial_buffer defined in raw.c  
to use my structure
So I made one myself that takes a pointer on my structure as an  
argument.
But If I want to use standard functions like fill_buffer defined in  
aviobuf.c, which file should I included ???

Thanks again everyone.


> [...]
> -- 
> Michael     GnuPG fingerprint:  
> 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> In fact, the RIAA has been known to suggest that students drop out
> of college or go to community college in order to be able to afford
> settlements. -- The RIAA
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel





More information about the ffmpeg-devel mailing list