Commit 0acb799b authored by sigmunau's avatar sigmunau

mkv.cpp: added support for quicktime video codecs in mkv (tested with svq3)

Modules.am: link mkv demux with mp4 demux
mp4/*: export some functions needed by mkv demux
parent 99c1c24f
...@@ -8,7 +8,7 @@ SOURCES_rawdv = rawdv.c ...@@ -8,7 +8,7 @@ SOURCES_rawdv = rawdv.c
SOURCES_au = au.c SOURCES_au = au.c
SOURCES_wav = wav.c SOURCES_wav = wav.c
SOURCES_aac = aac.c SOURCES_aac = aac.c
SOURCES_mkv = mkv.cpp SOURCES_mkv = mkv.cpp mp4/libmp4.c mp4/drms.c
SOURCES_livedotcom = livedotcom.cpp ../access/mms/asf.c ../access/mms/buffer.c SOURCES_livedotcom = livedotcom.cpp ../access/mms/asf.c ../access/mms/buffer.c
SOURCES_nsv = nsv.c SOURCES_nsv = nsv.c
SOURCES_real = real.c SOURCES_real = real.c
......
...@@ -75,6 +75,9 @@ ...@@ -75,6 +75,9 @@
#include "ebml/StdIOCallback.h" #include "ebml/StdIOCallback.h"
extern "C" {
#include "mp4/libmp4.h"
}
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
# include <zlib.h> # include <zlib.h>
#endif #endif
...@@ -568,6 +571,24 @@ static int Open( vlc_object_t * p_this ) ...@@ -568,6 +571,24 @@ static int Open( vlc_object_t * p_this )
tk.fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' ); tk.fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
} }
} }
else if( !strcmp( tk.psz_codec, "V_QUICKTIME" ) )
{
MP4_Box_t *p_box = (MP4_Box_t*)malloc( sizeof( MP4_Box_t ) );
MP4_Stream_t *p_mp4_stream = MP4_MemoryStream( p_demux->s,
tk.i_extra_data,
tk.p_extra_data );
MP4_ReadBoxCommon( p_mp4_stream, p_box );
MP4_ReadBox_sample_vide( p_mp4_stream, p_box );
tk.fmt.i_codec = p_box->i_type;
tk.fmt.video.i_width = p_box->data.p_sample_vide->i_width;
tk.fmt.video.i_height = p_box->data.p_sample_vide->i_height;
tk.fmt.i_extra = p_box->data.p_sample_vide->i_qt_image_description;
tk.fmt.p_extra = malloc( tk.fmt.i_extra );
memcpy( tk.fmt.p_extra, p_box->data.p_sample_vide->p_qt_image_description, tk.fmt.i_extra );
MP4_FreeBox_sample_vide( p_box );
free( p_box );
free( p_mp4_stream );
}
else if( !strcmp( tk.psz_codec, "A_MS/ACM" ) ) else if( !strcmp( tk.psz_codec, "A_MS/ACM" ) )
{ {
if( tk.i_extra_data < (int)sizeof( WAVEFORMATEX ) ) if( tk.i_extra_data < (int)sizeof( WAVEFORMATEX ) )
......
...@@ -324,7 +324,7 @@ int MP4_SeekStream( MP4_Stream_t *p_stream, off_t i_pos) ...@@ -324,7 +324,7 @@ int MP4_SeekStream( MP4_Stream_t *p_stream, off_t i_pos)
* *
* RETURN : 0 if it fail, 1 otherwise * RETURN : 0 if it fail, 1 otherwise
*****************************************************************************/ *****************************************************************************/
static int MP4_ReadBoxCommon( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) int MP4_ReadBoxCommon( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{ {
int i_read; int i_read;
uint8_t *p_peek; uint8_t *p_peek;
...@@ -1325,7 +1325,7 @@ static void MP4_FreeBox_sample_soun( MP4_Box_t *p_box ) ...@@ -1325,7 +1325,7 @@ static void MP4_FreeBox_sample_soun( MP4_Box_t *p_box )
} }
static int MP4_ReadBox_sample_vide( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) int MP4_ReadBox_sample_vide( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{ {
unsigned int i; unsigned int i;
...@@ -1390,7 +1390,7 @@ static int MP4_ReadBox_sample_vide( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1390,7 +1390,7 @@ static int MP4_ReadBox_sample_vide( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
} }
static void MP4_FreeBox_sample_vide( MP4_Box_t *p_box ) void MP4_FreeBox_sample_vide( MP4_Box_t *p_box )
{ {
FREE( p_box->data.p_sample_vide->p_qt_image_description ); FREE( p_box->data.p_sample_vide->p_qt_image_description );
} }
......
...@@ -915,3 +915,8 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, char *psz_fmt, ... ); ...@@ -915,3 +915,8 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, char *psz_fmt, ... );
*****************************************************************************/ *****************************************************************************/
int MP4_BoxCount( MP4_Box_t *p_box, char *psz_fmt, ... ); int MP4_BoxCount( MP4_Box_t *p_box, char *psz_fmt, ... );
MP4_Stream_t *MP4_MemoryStream( stream_t *s,
int i_size, uint8_t *p_buffer );
int MP4_ReadBoxCommon( MP4_Stream_t *p_stream, MP4_Box_t *p_box );
int MP4_ReadBox_sample_vide( MP4_Stream_t *p_stream, MP4_Box_t *p_box );
void MP4_FreeBox_sample_vide( MP4_Box_t *p_box );
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment