[vlc-devel] commit: Merged mp1v/mp2v codecs. (Laurent Aimar )

git version control git at videolan.org
Wed May 13 22:35:46 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed May 13 22:34:07 2009 +0200| [dfe8c5c087b8e968890136575cfc64dd82d7df6e] | committer: Laurent Aimar 

Merged mp1v/mp2v codecs.

The codec defined will only be used by encoder to force one of the types.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dfe8c5c087b8e968890136575cfc64dd82d7df6e
---

 include/vlc_fourcc.h            |    6 ++++--
 modules/access/dshow/dshow.cpp  |    4 ++--
 modules/access/dshow/filter.cpp |    2 +-
 modules/codec/avcodec/encoder.c |    3 ++-
 modules/codec/avcodec/fourcc.c  |    4 +---
 modules/codec/libmpeg2.c        |    4 +---
 modules/mux/mpeg/ps.c           |    6 ------
 modules/stream_out/record.c     |    4 ++--
 src/misc/fourcc.c               |   13 ++++++-------
 9 files changed, 19 insertions(+), 27 deletions(-)

diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index c041a8e..7bc4076 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -29,8 +29,6 @@
 
 /* Video codec */
 #define VLC_CODEC_MPGV      VLC_FOURCC('m','p','g','v')
-#define VLC_CODEC_MP1V      VLC_FOURCC('m','p','1','v')
-#define VLC_CODEC_MP2V      VLC_FOURCC('m','p','2','v')
 #define VLC_CODEC_MP4V      VLC_FOURCC('m','p','4','v')
 #define VLC_CODEC_DIV1      VLC_FOURCC('D','I','V','1')
 #define VLC_CODEC_DIV2      VLC_FOURCC('D','I','V','2')
@@ -292,6 +290,10 @@
 #   define VLC_CODEC_S32N VLC_CODEC_S32L
 #endif
 
+/* Non official codecs, used to force a profile in an encoder */
+#define VLC_CODEC_MP1V      VLC_FOURCC('m','p','1','v')
+#define VLC_CODEC_MP2V      VLC_FOURCC('m','p','2','v')
+
 /**
  * It returns the codec associatedto a fourcc within a ES category.
  *
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 729648a..9a6cf7c 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -491,7 +491,7 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
             if( /* Raw DV stream */
                 p_stream->i_fourcc == VLC_CODEC_DV ||
                 /* Raw MPEG video stream */
-                p_stream->i_fourcc == VLC_CODEC_MP2V )
+                p_stream->i_fourcc == VLC_CODEC_MPGV )
             {
                 b_use_audio = false;
 
@@ -729,7 +729,7 @@ static int AccessOpen( vlc_object_t *p_this )
             free( p_access->psz_demux );
             p_access->psz_demux = strdup( "rawdv" );
         }
-        else if( p_stream->i_fourcc == VLC_CODEC_MP2V )
+        else if( p_stream->i_fourcc == VLC_CODEC_MPGV )
         {
             free( p_access->psz_demux );
             p_access->psz_demux = strdup( "mpgv" );
diff --git a/modules/access/dshow/filter.cpp b/modules/access/dshow/filter.cpp
index 8262e66..a9f7d5c 100644
--- a/modules/access/dshow/filter.cpp
+++ b/modules/access/dshow/filter.cpp
@@ -286,7 +286,7 @@ int GetFourCCFromMediaType( const AM_MEDIA_TYPE &media_type )
 
             /* MPEG2 video elementary stream */
             else if( media_type.subtype == MEDIASUBTYPE_MPEG2_VIDEO )
-               i_fourcc = VLC_CODEC_MP2V;
+               i_fourcc = VLC_CODEC_MPGV;
 
             /* DivX video */
             else if( media_type.subtype == MEDIASUBTYPE_DIVX )
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 3894755..a77e1df 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -453,7 +453,8 @@ int OpenEncoder( vlc_object_t *p_this )
             __MAX( __MIN( p_sys->i_b_frames, FF_MAX_B_FRAMES ), 0 );
         p_context->b_frame_strategy = 0;
         if( !p_context->max_b_frames  &&
-            (  p_enc->fmt_out.i_codec == VLC_CODEC_MP2V ||
+            (  p_enc->fmt_out.i_codec == VLC_CODEC_MPGV ||
+               p_enc->fmt_out.i_codec == VLC_CODEC_MP2V ||
                p_enc->fmt_out.i_codec == VLC_CODEC_MP1V ) )
             p_context->flags |= CODEC_FLAG_LOW_DELAY;
 
diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
index 686b2fa..6e18746 100644
--- a/modules/codec/avcodec/fourcc.c
+++ b/modules/codec/avcodec/fourcc.c
@@ -52,9 +52,7 @@ static const struct
      * Video Codecs
      */
 
-    { VLC_CODEC_MP1V, CODEC_ID_MPEG1VIDEO, VIDEO_ES },
-
-    { VLC_CODEC_MP2V, CODEC_ID_MPEG2VIDEO, VIDEO_ES },
+    { VLC_CODEC_MPGV, CODEC_ID_MPEG2VIDEO, VIDEO_ES },
 
     { VLC_CODEC_MP4V, CODEC_ID_MPEG4, VIDEO_ES },
     /* 3ivx delta 3.5 Unsupported
diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c
index b456fa9..36f5569 100644
--- a/modules/codec/libmpeg2.c
+++ b/modules/codec/libmpeg2.c
@@ -119,9 +119,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_sys_t *p_sys;
     uint32_t i_accel = 0;
 
-    if( p_dec->fmt_in.i_codec != VLC_CODEC_MP1V &&
-        p_dec->fmt_in.i_codec != VLC_CODEC_MP2V &&
-        p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
         return VLC_EGENERIC;
 
     /* Select onl recognized original format (standard mpeg video) */
diff --git a/modules/mux/mpeg/ps.c b/modules/mux/mpeg/ps.c
index 724da3c..a7e4ef5 100644
--- a/modules/mux/mpeg/ps.c
+++ b/modules/mux/mpeg/ps.c
@@ -276,12 +276,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     /* Init this new stream */
     switch( p_input->p_fmt->i_codec )
     {
-        case VLC_CODEC_MP1V:
-            p_stream->i_stream_id =
-                StreamIdGet( p_sys->stream_id_mpgv, 0xe0, 0xef );
-            p_stream->i_stream_type = 0x01; /* ISO/IEC 11172 Video */
-            break;
-        case VLC_CODEC_MP2V:
         case VLC_CODEC_MPGV:
             p_stream->i_stream_id =
                 StreamIdGet( p_sys->stream_id_mpgv, 0xe0, 0xef );
diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index a3b1326..77f00a4 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -287,12 +287,12 @@ static const muxer_properties_t p_muxers[] = {
     M( "mp4", "mp4", INT_MAX,   VLC_CODEC_MP4A, VLC_CODEC_H264, VLC_CODEC_MP4V,
                                 VLC_CODEC_SUBT ),
 
-    M( "ps", "mpg", 16/* FIXME*/,VLC_CODEC_MPGV, VLC_CODEC_MP1V, VLC_CODEC_MP2V,
+    M( "ps", "mpg", 16/* FIXME*/,VLC_CODEC_MPGV,
                                 VLC_CODEC_MPGA, VLC_CODEC_DVD_LPCM, VLC_CODEC_A52,
                                 VLC_CODEC_DTS,
                                 VLC_CODEC_SPU ),
 
-    M( "ts", "ts", 8000,        VLC_CODEC_MPGV, VLC_CODEC_MP1V, VLC_CODEC_MP2V,
+    M( "ts", "ts", 8000,        VLC_CODEC_MPGV,
                                 VLC_CODEC_H264,
                                 VLC_CODEC_MPGA, VLC_CODEC_DVD_LPCM, VLC_CODEC_A52,
                                 VLC_CODEC_DTS, VLC_CODEC_MP4A,
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index d585992..b0a699c 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -56,16 +56,18 @@ typedef struct
 
 /* */
 static const entry_t p_list_video[] = {
-    B(VLC_CODEC_MP1V, "MPEG-1 Video"),
+
+    B(VLC_CODEC_MPGV, "MPEG-1/2 Video"),
+        A("mpgv"),
         A("mp1v"),
         A("mpeg"),
         A("mpg1"),
-        E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"),
-
-    B(VLC_CODEC_MP2V, "MPEG-2 Video"),
         A("mp2v"),
         A("MPEG"),
         A("mpg2"),
+
+        E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"),
+
         E("hdv1", "HDV 720p30 (MPEG-2 Video)"),
         E("hdv2", "Sony HDV (MPEG-2 Video)"),
         E("hdv3", "FCP HDV (MPEG-2 Video)"),
@@ -83,9 +85,6 @@ static const entry_t p_list_video[] = {
         E("xdv2", "XDCAM HD 1080i60"),
         E("AVmp", "AVID IMX PAL"),
 
-    B(VLC_CODEC_MPGV, "MPEG-1/2 Video"),
-        A("mpgv"),
-
     B(VLC_CODEC_MP4V, "MPEG-4 Video"),
         A("mp4v"),
         A("DIVX"),




More information about the vlc-devel mailing list