[vlc-devel] [PATCH 0/3] win32 BDA patches

John Freed okvlc at johnfreed.com
Fri Mar 16 10:43:06 CET 2012


separate note -- the dshow patch is NOT necessary for the others to
work. But it could fix mysterious crashes. I submitted it based on my
experience with the BDA graphs -- it's the only other place in the VLC
code that tries to Release filters, so far as I can tell.


On Fri, Mar 16, 2012 at 10:31 AM,  <vlc-devel-request at videolan.org> wrote:
> Subject: Re: [vlc-devel] [PATCH 0/3] win32 BDA patches
> Message-ID:
>        <CAEVvu1OJ=2av6aNAWnyNezOppooNsAK=uvD8=JfgdZxSPHMBXg at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> You can test the dshow part separately; please let me know how it
> turns out. This was a maddening situation that took a long time to
> figure out. Here is the Win32 (under XP and Win7) behavior I found:
>
> Case 1
> - Create a filter by binding moniker
> - set to NULL -- crash, as expected [note, I didn't test doing a
> Release() on the filter at this point but expect it would succeed]
>
> Case 2
> - Create filter
> - AddFilter to graph
> - RemoveFilter from graph
> - Release filter -- crash, not expected
>
> Case 3
> - Create filter
> - AddFilter to graph
> - RemoveFilter from graph
> - set to NULL -- no problem
>
> Fortunately it was 100% reproducible.
>
> This behavior was not at all what I expected, and I don't see any
> documentation of it in MSDN, though this whole area is poorly
> documented.
>
>
>> Message: 10
>> Date: Fri, 16 Mar 2012 09:10:04 +0200
>> From: Kaarlo R?ih? <kaarlo.raiha at gmail.com>
>> To: Mailing list for VLC media player developers
>> ? ? ? ?<vlc-devel at videolan.org>
>> Subject: Re: [vlc-devel] [PATCH 0/3] win32 BDA patches
>> Message-ID:
>> ? ? ? ?<CAMKrNtx3HKY0ohYSUXYJ_Wwhu7F1sSgfrRs40agp=s7KCjrTrg at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> 16. maaliskuuta 2012 0.56 Jean-Baptiste Kempf <jb at videolan.org> kirjoitti:
>>
>>> On Thu, Mar 15, 2012 at 09:54:25PM +0100, John Freed wrote :
>>> > John Freed (3):
>>> > ? dshow: Remove filters but don't Release() them
>>> > ? dtv: Thorough rewrite of BDA graph for Win32
>>>
>>> Is anyone able to review those 2 patches?
>>> Or should we apply and wait for tester feedback?
>>>
>>
>> +1 for applying since AFAIK BDA doesn't work in current releases. And I can
>> test dshow part that way easier.
>>
>>
>>>
>>> Best regards,
>>>
>>> --
>>> Jean-Baptiste Kempf
>>> http://www.jbkempf.com/ - +33 672 704 734
>>> Sent from my Electronic Device
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 16 Mar 2012 10:31:24 +0100
> From: fyhuel at viotech.net
> To: vlc-devel at videolan.org
> Subject: [vlc-devel] [PATCH] demux/mp4: add parsing of sidx box
> Message-ID: <4f630876.8a0eb40a.4080.ffff89e3 at mx.google.com>
> Content-Type: text/plain; charset=UTF-8
>
> From: Fr?d?ric Yhuel <fyhuel at viotech.net>
>
> This is a DASH specific box. See [1] for its definition.
> It will probably be useful in a near future, and I will use it at a
> workaround to get fragment duration when tfhd and trun boxes don't give
> (default) sample duration(s).
>
> [1] http://www.3gpp.org/ftp/Inbox/LSs_from_external_bodies/ISO_IEC_JTC1_SG29_WG11/29n12310.zip
> ---
>  modules/demux/mp4/libmp4.c |   63 ++++++++++++++++++++++++++++++++++++++++++++
>  modules/demux/mp4/libmp4.h |   28 +++++++++++++++++++
>  2 files changed, 91 insertions(+), 0 deletions(-)
>
> diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
> index 59badec..f8ad718 100644
> --- a/modules/demux/mp4/libmp4.c
> +++ b/modules/demux/mp4/libmp4.c
> @@ -507,6 +507,68 @@ static int MP4_ReadBox_mfhd(  stream_t *p_stream, MP4_Box_t *p_box )
>     MP4_READBOX_EXIT( 1 );
>  }
>
> +static int MP4_ReadBox_sidx(  stream_t *p_stream, MP4_Box_t *p_box )
> +{
> +    MP4_READBOX_ENTER( MP4_Box_data_sidx_t );
> +
> +    MP4_Box_data_sidx_t *p_sidx_data = p_box->data.p_sidx;
> +    MP4_GETVERSIONFLAGS( p_sidx_data );
> +
> +    MP4_GET4BYTES( p_sidx_data->i_reference_ID );
> +    MP4_GET4BYTES( p_sidx_data->i_timescale );
> +
> +    if( p_sidx_data->i_version == 0 )
> +    {
> +        MP4_GET4BYTES( p_sidx_data->i_earliest_presentation_time );
> +        MP4_GET4BYTES( p_sidx_data->i_first_offset );
> +    }
> +    else
> +    {
> +        MP4_GET8BYTES( p_sidx_data->i_earliest_presentation_time );
> +        MP4_GET8BYTES( p_sidx_data->i_first_offset );
> +    }
> +
> +    uint16_t i_reserved;
> +    MP4_GET2BYTES( i_reserved );
> +    MP4_GET2BYTES( p_sidx_data->i_reference_count );
> +    uint16_t i_count = p_sidx_data->i_reference_count;
> +
> +    p_sidx_data->p_items = calloc( i_count, sizeof( MP4_Box_sidx_item_t ) );
> +    uint32_t tmp;
> +    for( unsigned i = 0; i < i_count; i++ )
> +    {
> +        MP4_GET4BYTES( tmp );
> +        p_sidx_data->p_items[i].b_reference_type = (bool)((tmp & 0x80000000)>>24);
> +        p_sidx_data->p_items[i].i_referenced_size = tmp & 0x7fffffff;
> +        MP4_GET4BYTES( p_sidx_data->p_items[i].i_subsegment_duration );
> +
> +        MP4_GET4BYTES( tmp );
> +        p_sidx_data->p_items[i].b_starts_with_SAP = (bool)((tmp & 0x80000000)>>24);
> +        p_sidx_data->p_items[i].i_SAP_type = (tmp & 0x70000000)>>24;
> +        p_sidx_data->p_items[i].i_SAP_delta_time = tmp & 0xfffffff;
> +    }
> +
> +#ifdef MP4_VERBOSE
> +    msg_Dbg( p_stream, "read box: \"sidx\" version %d, flags 0x%x, "\
> +            "ref_ID %"PRIu32", timescale %"PRIu32", ref_count %"PRIu16", "\
> +            "first subsegmt duration %"PRIu32,
> +                p_sidx_data->i_version,
> +                p_sidx_data->i_flags,
> +                p_sidx_data->i_reference_ID,
> +                p_sidx_data->i_timescale,
> +                p_sidx_data->i_reference_count,
> +                p_sidx_data->p_items[0].i_subsegment_duration
> +           );
> +#endif
> +
> +    MP4_READBOX_EXIT( 1 );
> +}
> +
> +static void MP4_FreeBox_sidx( MP4_Box_t *p_box )
> +{
> +    FREENULL( p_box->data.p_sidx->p_items );
> +}
> +
>  static int MP4_ReadBox_tfhd(  stream_t *p_stream, MP4_Box_t *p_box )
>  {
>     MP4_READBOX_ENTER( MP4_Box_data_tfhd_t );
> @@ -3228,6 +3290,7 @@ static const struct
>     { ATOM_traf,    MP4_ReadBoxContainer,     MP4_FreeBox_Common },
>     { ATOM_mfra,    MP4_ReadBoxContainer,     MP4_FreeBox_Common },
>     { ATOM_mfhd,    MP4_ReadBox_mfhd,         MP4_FreeBox_Common },
> +    { ATOM_sidx,    MP4_ReadBox_sidx,         MP4_FreeBox_sidx },
>     { ATOM_tfhd,    MP4_ReadBox_tfhd,         MP4_FreeBox_Common },
>     { ATOM_trun,    MP4_ReadBox_trun,         MP4_FreeBox_trun },
>     { ATOM_trex,    MP4_ReadBox_trex,         MP4_FreeBox_Common },
> diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
> index d5df419..f525d56 100644
> --- a/modules/demux/mp4/libmp4.h
> +++ b/modules/demux/mp4/libmp4.h
> @@ -78,6 +78,7 @@
>  #define ATOM_mehd VLC_FOURCC( 'm', 'e', 'h', 'd' )
>  #define ATOM_mfhd VLC_FOURCC( 'm', 'f', 'h', 'd' )
>  #define ATOM_traf VLC_FOURCC( 't', 'r', 'a', 'f' )
> +#define ATOM_sidx VLC_FOURCC( 's', 'i', 'd', 'x' )
>  #define ATOM_tfhd VLC_FOURCC( 't', 'f', 'h', 'd' )
>  #define ATOM_trun VLC_FOURCC( 't', 'r', 'u', 'n' )
>  #define ATOM_cprt VLC_FOURCC( 'c', 'p', 'r', 't' )
> @@ -866,6 +867,32 @@ typedef struct MP4_Box_data_mfhd_s
>
>  } MP4_Box_data_mfhd_t;
>
> +typedef struct MP4_Box_sidx_item_s
> +{
> +    bool     b_reference_type;
> +    uint32_t i_referenced_size;
> +    uint32_t i_subsegment_duration;
> +    bool     b_starts_with_SAP;
> +    uint8_t  i_SAP_type;
> +    uint32_t i_SAP_delta_time;
> +
> +} MP4_Box_sidx_item_t;
> +
> +typedef struct MP4_Box_data_sidx_s
> +{
> +    uint8_t  i_version;
> +    uint32_t i_flags;
> +
> +    uint32_t i_reference_ID;
> +    uint32_t i_timescale;
> +    uint64_t i_earliest_presentation_time;
> +    uint64_t i_first_offset;
> +    uint16_t i_reference_count;
> +
> +    MP4_Box_sidx_item_t *p_items;
> +
> +} MP4_Box_data_sidx_t;
> +
>  #define MP4_TFHD_BASE_DATA_OFFSET     (1LL<<0)
>  #define MP4_TFHD_SAMPLE_DESC_INDEX    (1LL<<1)
>  #define MP4_TFHD_DFLT_SAMPLE_DURATION (1LL<<3)
> @@ -1091,6 +1118,7 @@ typedef union MP4_Box_data_s
>     MP4_Box_data_ftyp_t *p_ftyp;
>     MP4_Box_data_mvhd_t *p_mvhd;
>     MP4_Box_data_mfhd_t *p_mfhd;
> +    MP4_Box_data_sidx_t *p_sidx;
>     MP4_Box_data_tfhd_t *p_tfhd;
>     MP4_Box_data_trun_t *p_trun;
>     MP4_Box_data_tkhd_t *p_tkhd;
> --
> 1.7.5.4
>
>
>
> ------------------------------
>
> _______________________________________________
> vlc-devel mailing list
> vlc-devel at videolan.org
> http://mailman.videolan.org/listinfo/vlc-devel
>
>
> End of vlc-devel Digest, Vol 58, Issue 118
> ******************************************
>



More information about the vlc-devel mailing list