1 /*****************************************************************************
2 * demux.c: demuxer using ffmpeg (libavformat).
3 *****************************************************************************
4 * Copyright (C) 2004-2009 the VideoLAN team
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 * Gildas Bazin <gbazin@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
33 #include <vlc_common.h>
34 #include <vlc_demux.h>
35 #include <vlc_stream.h>
37 #include <vlc_input.h>
38 #include <vlc_charset.h>
39 #include <vlc_avcodec.h>
42 #if defined(HAVE_LIBAVFORMAT_AVFORMAT_H)
43 # include <libavformat/avformat.h>
44 #elif defined(HAVE_FFMPEG_AVFORMAT_H)
45 # include <ffmpeg/avformat.h>
48 #include "../../codec/avcodec/avcodec.h"
50 #include "../vobsub.h"
52 //#define AVFORMAT_DEBUG 1
54 /* Version checking */
55 #if defined(HAVE_FFMPEG_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_AVFORMAT_H)
57 #if (LIBAVCODEC_VERSION_INT >= ((51<<16)+(50<<8)+0) )
58 # define HAVE_FFMPEG_CODEC_ATTACHMENT 1
61 #if (LIBAVFORMAT_VERSION_INT >= ((52<<16)+(15<<8)+0) )
62 # define HAVE_FFMPEG_CHAPTERS 1
65 /*****************************************************************************
66 * demux_sys_t: demux descriptor
67 *****************************************************************************/
87 input_attachment_t **attachments;
89 /* Only one title with seekpoints possible atm. */
90 input_title_t *p_title;
93 /*****************************************************************************
95 *****************************************************************************/
96 static int Demux ( demux_t *p_demux );
97 static int Control( demux_t *p_demux, int i_query, va_list args );
99 static int IORead( void *opaque, uint8_t *buf, int buf_size );
100 static int64_t IOSeek( void *opaque, int64_t offset, int whence );
102 static void UpdateSeekPoint( demux_t *p_demux, int64_t i_time );
104 /*****************************************************************************
106 *****************************************************************************/
107 int OpenDemux( vlc_object_t *p_this )
109 demux_t *p_demux = (demux_t*)p_this;
115 int64_t i_start_time = -1;
117 /* Init Probe data */
118 pd.filename = p_demux->psz_path;
119 if( ( pd.buf_size = stream_Peek( p_demux->s, &pd.buf, 2048 ) ) <= 0 )
121 msg_Warn( p_demux, "cannot peek" );
125 av_register_all(); /* Can be called several times */
128 if( !( fmt = av_probe_input_format( &pd, 1 ) ) )
130 msg_Dbg( p_demux, "couldn't guess format" );
134 /* Don't try to handle MPEG unless forced */
135 if( !p_demux->b_force &&
136 ( !strcmp( fmt->name, "mpeg" ) ||
137 !strcmp( fmt->name, "vcd" ) ||
138 !strcmp( fmt->name, "vob" ) ||
139 !strcmp( fmt->name, "mpegts" ) ||
140 /* libavformat's redirector won't work */
141 !strcmp( fmt->name, "redir" ) ||
142 !strcmp( fmt->name, "sdp" ) ) )
147 /* Don't trigger false alarms on bin files */
148 if( !p_demux->b_force && !strcmp( fmt->name, "psxstr" ) )
152 if( !p_demux->psz_path ) return VLC_EGENERIC;
154 i_len = strlen( p_demux->psz_path );
155 if( i_len < 4 ) return VLC_EGENERIC;
157 if( strcasecmp( &p_demux->psz_path[i_len - 4], ".str" ) &&
158 strcasecmp( &p_demux->psz_path[i_len - 4], ".xai" ) &&
159 strcasecmp( &p_demux->psz_path[i_len - 3], ".xa" ) )
165 msg_Dbg( p_demux, "detected format: %s", fmt->name );
167 /* Fill p_demux fields */
168 p_demux->pf_demux = Demux;
169 p_demux->pf_control = Control;
170 p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
175 p_sys->i_pcr_tk = -1;
177 TAB_INIT( p_sys->i_attachments, p_sys->attachments);
178 p_sys->p_title = NULL;
180 /* Create I/O wrapper */
181 p_sys->io_buffer_size = 32768; /* FIXME */
182 p_sys->io_buffer = malloc( p_sys->io_buffer_size );
183 p_sys->url.priv_data = p_demux;
184 p_sys->url.prot = &p_sys->prot;
185 p_sys->url.prot->name = "VLC I/O wrapper";
186 p_sys->url.prot->url_open = 0;
187 p_sys->url.prot->url_read =
188 (int (*) (URLContext *, unsigned char *, int))IORead;
189 p_sys->url.prot->url_write = 0;
190 p_sys->url.prot->url_seek =
191 (int64_t (*) (URLContext *, int64_t, int))IOSeek;
192 p_sys->url.prot->url_close = 0;
193 p_sys->url.prot->next = 0;
194 init_put_byte( &p_sys->io, p_sys->io_buffer, p_sys->io_buffer_size,
195 0, &p_sys->url, IORead, NULL, IOSeek );
197 b_avfmt_nofile = p_sys->fmt->flags & AVFMT_NOFILE;
198 p_sys->fmt->flags |= AVFMT_NOFILE; /* libavformat must not fopen/fclose */
201 if( av_open_input_stream( &p_sys->ic, &p_sys->io, p_demux->psz_path,
204 msg_Err( p_demux, "av_open_input_stream failed" );
205 if( !b_avfmt_nofile ) p_sys->fmt->flags ^= AVFMT_NOFILE;
206 CloseDemux( p_this );
210 vlc_avcodec_lock(); /* avformat calls avcodec behind our back!!! */
211 if( av_find_stream_info( p_sys->ic ) < 0 )
213 vlc_avcodec_unlock();
214 msg_Err( p_demux, "av_find_stream_info failed" );
215 if( !b_avfmt_nofile ) p_sys->fmt->flags ^= AVFMT_NOFILE;
216 CloseDemux( p_this );
219 vlc_avcodec_unlock();
220 if( !b_avfmt_nofile ) p_sys->fmt->flags ^= AVFMT_NOFILE;
222 for( i = 0; i < p_sys->ic->nb_streams; i++ )
224 AVCodecContext *cc = p_sys->ic->streams[i]->codec;
228 const char *psz_type = "unknown";
230 if( !GetVlcFourcc( cc->codec_id, NULL, &fcc, NULL ) )
231 fcc = VLC_FOURCC( 'u', 'n', 'd', 'f' );
233 switch( cc->codec_type )
235 case CODEC_TYPE_AUDIO:
236 es_format_Init( &fmt, AUDIO_ES, fcc );
237 fmt.audio.i_channels = cc->channels;
238 fmt.audio.i_rate = cc->sample_rate;
239 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
240 fmt.audio.i_bitspersample = cc->bits_per_sample;
242 fmt.audio.i_bitspersample = cc->bits_per_coded_sample;
244 fmt.audio.i_blockalign = cc->block_align;
248 case CODEC_TYPE_VIDEO:
249 es_format_Init( &fmt, VIDEO_ES, fcc );
251 /* Special case for raw video data */
252 if( cc->codec_id == CODEC_ID_RAWVIDEO )
254 msg_Dbg( p_demux, "raw video, pixel format: %i", cc->pix_fmt );
255 if( GetVlcChroma( &fmt.video, cc->pix_fmt ) != VLC_SUCCESS)
257 msg_Err( p_demux, "was unable to find a FourCC match for raw video" );
260 fmt.i_codec = fmt.video.i_chroma;
263 fmt.video.i_width = cc->width;
264 fmt.video.i_height = cc->height;
267 fmt.video.p_palette = malloc( sizeof(video_palette_t) );
268 *fmt.video.p_palette = *(video_palette_t *)cc->palctrl;
273 case CODEC_TYPE_SUBTITLE:
274 es_format_Init( &fmt, SPU_ES, fcc );
275 if( strncmp( p_sys->ic->iformat->name, "matroska", 8 ) == 0 &&
276 cc->codec_id == CODEC_ID_DVD_SUBTITLE &&
277 cc->extradata != NULL &&
278 cc->extradata_size > 0 )
281 char *psz_buf = malloc( cc->extradata_size + 1);
282 if( psz_buf != NULL )
284 memcpy( psz_buf, cc->extradata , cc->extradata_size );
285 psz_buf[cc->extradata_size] = '\0';
287 psz_start = strstr( psz_buf, "size:" );
289 vobsub_size_parse( psz_start,
290 &fmt.subs.spu.i_original_frame_width,
291 &fmt.subs.spu.i_original_frame_height ) == VLC_SUCCESS )
293 msg_Dbg( p_demux, "original frame size: %dx%d",
294 fmt.subs.spu.i_original_frame_width,
295 fmt.subs.spu.i_original_frame_height );
299 msg_Warn( p_demux, "reading original frame size failed" );
302 psz_start = strstr( psz_buf, "palette:" );
304 vobsub_palette_parse( psz_start, &fmt.subs.spu.palette[1] ) == VLC_SUCCESS )
306 fmt.subs.spu.palette[0] = 0xBeef;
307 msg_Dbg( p_demux, "vobsub palette read" );
311 msg_Warn( p_demux, "reading original palette failed" );
317 psz_type = "subtitle";
321 es_format_Init( &fmt, UNKNOWN_ES, 0 );
322 #ifdef HAVE_FFMPEG_CODEC_ATTACHMENT
323 if( cc->codec_type == CODEC_TYPE_ATTACHMENT )
325 input_attachment_t *p_attachment;
326 psz_type = "attachment";
327 if( cc->codec_id == CODEC_ID_TTF )
329 p_attachment = vlc_input_attachment_New( p_sys->ic->streams[i]->filename, "application/x-truetype-font", NULL,
330 cc->extradata, (int)cc->extradata_size );
331 TAB_APPEND( p_sys->i_attachments, p_sys->attachments, p_attachment );
333 else msg_Warn( p_demux, "unsupported attachment type in ffmpeg demux" );
338 if( cc->codec_type == CODEC_TYPE_DATA )
341 msg_Warn( p_demux, "unsupported track type in ffmpeg demux" );
344 fmt.psz_language = p_sys->ic->streams[i]->language;
346 #ifdef HAVE_FFMPEG_CODEC_ATTACHMENT
347 if( cc->codec_type != CODEC_TYPE_ATTACHMENT )
350 fmt.i_extra = cc->extradata_size;
351 fmt.p_extra = cc->extradata;
353 es = es_out_Add( p_demux->out, &fmt );
355 msg_Dbg( p_demux, "adding es: %s codec = %4.4s",
356 psz_type, (char*)&fcc );
357 TAB_APPEND( p_sys->i_tk, p_sys->tk, es );
359 if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
360 i_start_time = p_sys->ic->start_time * 1000000 / AV_TIME_BASE;
362 msg_Dbg( p_demux, "AVFormat supported stream" );
363 msg_Dbg( p_demux, " - format = %s (%s)",
364 p_sys->fmt->name, p_sys->fmt->long_name );
365 msg_Dbg( p_demux, " - start time = %"PRId64, i_start_time );
366 msg_Dbg( p_demux, " - duration = %"PRId64,
367 ( p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE ) ?
368 p_sys->ic->duration * 1000000 / AV_TIME_BASE : -1 );
370 #ifdef HAVE_FFMPEG_CHAPTERS
371 if( p_sys->ic->nb_chapters > 0 )
372 p_sys->p_title = vlc_input_title_New();
373 for( i = 0; i < p_sys->ic->nb_chapters; i++ )
375 seekpoint_t *s = vlc_seekpoint_New();
377 if( p_sys->ic->chapters[i]->title )
379 s->psz_name = strdup( p_sys->ic->chapters[i]->title );
380 EnsureUTF8( s->psz_name );
381 msg_Dbg( p_demux, " - chapter %d: %s", i, s->psz_name );
383 s->i_time_offset = p_sys->ic->chapters[i]->start * 1000000 *
384 p_sys->ic->chapters[i]->time_base.num /
385 p_sys->ic->chapters[i]->time_base.den -
386 (i_start_time != -1 ? i_start_time : 0 );
387 TAB_APPEND( p_sys->p_title->i_seekpoint, p_sys->p_title->seekpoint, s );
394 /*****************************************************************************
396 *****************************************************************************/
397 void CloseDemux( vlc_object_t *p_this )
399 demux_t *p_demux = (demux_t*)p_this;
400 demux_sys_t *p_sys = p_demux->p_sys;
403 FREENULL( p_sys->tk );
405 b_avfmt_nofile = p_sys->fmt->flags & AVFMT_NOFILE;
406 p_sys->fmt->flags |= AVFMT_NOFILE; /* libavformat must not fopen/fclose */
407 if( p_sys->ic ) av_close_input_file( p_sys->ic );
408 if( !b_avfmt_nofile ) p_sys->fmt->flags ^= AVFMT_NOFILE;
410 for( int i = 0; i < p_sys->i_attachments; i++ )
411 free( p_sys->attachments[i] );
412 TAB_CLEAN( p_sys->i_attachments, p_sys->attachments);
415 vlc_input_title_Delete( p_sys->p_title );
417 free( p_sys->io_buffer );
421 /*****************************************************************************
423 *****************************************************************************/
424 static int Demux( demux_t *p_demux )
426 demux_sys_t *p_sys = p_demux->p_sys;
429 int64_t i_start_time;
432 if( av_read_frame( p_sys->ic, &pkt ) )
436 if( pkt.stream_index < 0 || pkt.stream_index >= p_sys->i_tk )
438 av_free_packet( &pkt );
441 const AVStream *p_stream = p_sys->ic->streams[pkt.stream_index];
443 if( ( p_frame = block_New( p_demux, pkt.size ) ) == NULL )
448 memcpy( p_frame->p_buffer, pkt.data, pkt.size );
450 if( pkt.flags & PKT_FLAG_KEY )
451 p_frame->i_flags |= BLOCK_FLAG_TYPE_I;
453 i_start_time = ( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE ) ?
454 ( p_sys->ic->start_time * 1000000 / AV_TIME_BASE ) : 0;
456 p_frame->i_dts = ( pkt.dts == (int64_t)AV_NOPTS_VALUE ) ?
457 0 : (pkt.dts) * 1000000 *
458 p_stream->time_base.num /
459 p_stream->time_base.den - i_start_time;
460 p_frame->i_pts = ( pkt.pts == (int64_t)AV_NOPTS_VALUE ) ?
461 0 : (pkt.pts) * 1000000 *
462 p_stream->time_base.num /
463 p_stream->time_base.den - i_start_time;
464 if( pkt.duration > 0 )
465 p_frame->i_length = pkt.duration * 1000000 *
466 p_stream->time_base.num /
467 p_stream->time_base.den - i_start_time;
469 if( pkt.dts != AV_NOPTS_VALUE && pkt.dts == pkt.pts &&
470 p_stream->codec->codec_type == CODEC_TYPE_VIDEO )
472 /* Add here notoriously bugged file formats/samples regarding PTS */
473 if( !strcmp( p_sys->fmt->name, "flv" ) )
476 #ifdef AVFORMAT_DEBUG
477 msg_Dbg( p_demux, "tk[%d] dts=%"PRId64" pts=%"PRId64,
478 pkt.stream_index, p_frame->i_dts, p_frame->i_pts );
482 ( pkt.stream_index == p_sys->i_pcr_tk || p_sys->i_pcr_tk < 0 ) )
484 p_sys->i_pcr_tk = pkt.stream_index;
485 p_sys->i_pcr = p_frame->i_dts;
487 es_out_Control( p_demux->out, ES_OUT_SET_PCR, (int64_t)p_sys->i_pcr );
490 es_out_Send( p_demux->out, p_sys->tk[pkt.stream_index], p_frame );
492 UpdateSeekPoint( p_demux, p_sys->i_pcr);
493 av_free_packet( &pkt );
497 static void UpdateSeekPoint( demux_t *p_demux, int64_t i_time )
499 demux_sys_t *p_sys = p_demux->p_sys;
502 if( !p_sys->p_title )
505 for( i = 0; i < p_sys->p_title->i_seekpoint; i++ )
507 if( i_time < p_sys->p_title->seekpoint[i]->i_time_offset )
512 if( i != p_demux->info.i_seekpoint && i >= 0 )
514 p_demux->info.i_seekpoint = i;
515 p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
519 /*****************************************************************************
521 *****************************************************************************/
522 static int Control( demux_t *p_demux, int i_query, va_list args )
524 demux_sys_t *p_sys = p_demux->p_sys;
530 case DEMUX_GET_POSITION:
531 pf = (double*) va_arg( args, double* ); *pf = 0.0;
532 i64 = stream_Size( p_demux->s );
535 double current = stream_Tell( p_demux->s );
536 *pf = current / (double)i64;
539 if( (p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE) && (p_sys->i_pcr > 0) )
541 *pf = (double)p_sys->i_pcr / (double)p_sys->ic->duration;
546 case DEMUX_SET_POSITION:
547 f = (double) va_arg( args, double );
548 if( p_sys->i_pcr > 0 )
550 i64 = p_sys->ic->duration * f;
551 if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
552 i64 += p_sys->ic->start_time;
554 msg_Warn( p_demux, "DEMUX_SET_POSITION: %"PRId64, i64 );
556 /* If we have a duration, we prefer to seek by time
557 but if we don't, or if the seek fails, try BYTE seeking */
558 if( p_sys->ic->duration == (int64_t)AV_NOPTS_VALUE ||
559 (av_seek_frame( p_sys->ic, -1, i64, 0 ) < 0) )
561 int64_t i_size = stream_Size( p_demux->s );
564 msg_Warn( p_demux, "DEMUX_SET_BYTE_POSITION: %"PRId64, i64 );
565 if( av_seek_frame( p_sys->ic, -1, i64, AVSEEK_FLAG_BYTE ) < 0 )
570 UpdateSeekPoint( p_demux, i64 );
572 p_sys->i_pcr = -1; /* Invalidate time display */
576 case DEMUX_GET_LENGTH:
577 pi64 = (int64_t*)va_arg( args, int64_t * );
578 if( p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE )
580 *pi64 = p_sys->ic->duration;
586 pi64 = (int64_t*)va_arg( args, int64_t * );
587 *pi64 = p_sys->i_pcr;
591 i64 = (int64_t)va_arg( args, int64_t );
592 i64 = i64 *AV_TIME_BASE / 1000000;
593 if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
594 i64 += p_sys->ic->start_time;
596 msg_Warn( p_demux, "DEMUX_SET_TIME: %"PRId64, i64 );
598 if( av_seek_frame( p_sys->ic, -1, i64, 0 ) < 0 )
602 p_sys->i_pcr = -1; /* Invalidate time display */
603 UpdateSeekPoint( p_demux, i64 );
606 case DEMUX_HAS_UNSUPPORTED_META:
608 bool *pb_bool = (bool*)va_arg( args, bool* );
616 vlc_meta_t *p_meta = (vlc_meta_t*)va_arg( args, vlc_meta_t* );
618 if( !p_sys->ic->title[0] || !p_sys->ic->author[0] ||
619 !p_sys->ic->copyright[0] || !p_sys->ic->comment[0] ||
620 /*!p_sys->ic->album[0] ||*/ !p_sys->ic->genre[0] )
625 if( p_sys->ic->title[0] )
626 vlc_meta_SetTitle( p_meta, p_sys->ic->title );
627 if( p_sys->ic->author[0] )
628 vlc_meta_SetArtist( p_meta, p_sys->ic->author );
629 if( p_sys->ic->copyright[0] )
630 vlc_meta_SetCopyright( p_meta, p_sys->ic->copyright );
631 if( p_sys->ic->comment[0] )
632 vlc_meta_SetDescription( p_meta, p_sys->ic->comment );
633 if( p_sys->ic->genre[0] )
634 vlc_meta_SetGenre( p_meta, p_sys->ic->genre );
638 case DEMUX_GET_ATTACHMENTS:
640 input_attachment_t ***ppp_attach =
641 (input_attachment_t***)va_arg( args, input_attachment_t*** );
642 int *pi_int = (int*)va_arg( args, int * );
645 if( p_sys->i_attachments <= 0 )
648 *pi_int = p_sys->i_attachments;;
649 *ppp_attach = malloc( sizeof(input_attachment_t**) * p_sys->i_attachments );
650 for( i = 0; i < p_sys->i_attachments; i++ )
651 (*ppp_attach)[i] = vlc_input_attachment_Duplicate( p_sys->attachments[i] );
655 case DEMUX_GET_TITLE_INFO:
657 input_title_t ***ppp_title = (input_title_t***)va_arg( args, input_title_t*** );
658 int *pi_int = (int*)va_arg( args, int* );
659 int *pi_title_offset = (int*)va_arg( args, int* );
660 int *pi_seekpoint_offset = (int*)va_arg( args, int* );
662 if( !p_sys->p_title )
666 *ppp_title = malloc( sizeof( input_title_t**) );
667 (*ppp_title)[0] = vlc_input_title_Duplicate( p_sys->p_title );
668 *pi_title_offset = 0;
669 *pi_seekpoint_offset = 0;
672 case DEMUX_SET_TITLE:
674 const int i_title = (int)va_arg( args, int );
675 if( !p_sys->p_title || i_title != 0 )
679 case DEMUX_SET_SEEKPOINT:
681 const int i_seekpoint = (int)va_arg( args, int );
682 if( !p_sys->p_title )
685 i64 = p_sys->p_title->seekpoint[i_seekpoint]->i_time_offset *AV_TIME_BASE / 1000000;
686 if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
687 i64 += p_sys->ic->start_time;
689 msg_Warn( p_demux, "DEMUX_SET_TIME: %"PRId64, i64 );
691 if( av_seek_frame( p_sys->ic, -1, i64, 0 ) < 0 )
695 p_sys->i_pcr = -1; /* Invalidate time display */
696 UpdateSeekPoint( p_demux, i64 );
706 /*****************************************************************************
707 * I/O wrappers for libavformat
708 *****************************************************************************/
709 static int IORead( void *opaque, uint8_t *buf, int buf_size )
711 URLContext *p_url = opaque;
712 demux_t *p_demux = p_url->priv_data;
713 if( buf_size < 0 ) return -1;
714 int i_ret = stream_Read( p_demux->s, buf, buf_size );
715 return i_ret ? i_ret : -1;
718 static int64_t IOSeek( void *opaque, int64_t offset, int whence )
720 URLContext *p_url = opaque;
721 demux_t *p_demux = p_url->priv_data;
723 int64_t i_size = stream_Size( p_demux->s );
725 #ifdef AVFORMAT_DEBUG
726 msg_Warn( p_demux, "IOSeek offset: %"PRId64", whence: %i", offset, whence );
736 i_absolute = (int64_t)offset;
739 i_absolute = stream_Tell( p_demux->s ) + (int64_t)offset;
742 i_absolute = i_size + (int64_t)offset;
751 msg_Dbg( p_demux, "Trying to seek before the beginning" );
755 if( i_size > 0 && i_absolute >= i_size )
757 msg_Dbg( p_demux, "Trying to seek too far : EOF?" );
761 if( stream_Seek( p_demux->s, i_absolute ) )
763 msg_Warn( p_demux, "we were not allowed to seek, or EOF " );
767 return stream_Tell( p_demux->s );
770 #endif /* HAVE_LIBAVFORMAT_AVFORMAT_H */