[vlc-commits] [Git][videolan/vlc][3.0.x] 3 commits: dshow: add mapping for H264 subtypes

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Oct 28 12:15:00 UTC 2026



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
72c31d9e by Dmitry Buzdyk at 2026-10-28T12:06:00+00:00
dshow: add mapping for H264 subtypes

Map H264 subtypes containing H264 bitstream in Annex B format to VLC_CODEC_H264
https://docs.microsoft.com/en-us/windows/win32/directshow/h-264-video-types

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
(cherry picked from commit 0c66be6e99a517fc7a4f167027ba33703919a677)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
30270a97 by Steve Lhomme at 2026-10-28T12:06:00+00:00
access/dshow: pass the chroma as a vlc_fourcc_t

(cherry picked from commit bdc46d9a280cc6f3bceac38dc4cac5a038c00fcb)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
56226424 by Steve Lhomme at 2026-10-28T12:06:00+00:00
access/dshow: fix sign warning

(cherry picked from commit 1127d5fc7e88a0ee6fed103ad1e3c16a7d40de8a)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -


3 changed files:

- modules/access/dshow/dshow.cpp
- modules/access/dshow/filter.cpp
- modules/access/dshow/filter.h


Changes:

=====================================
modules/access/dshow/dshow.cpp
=====================================
@@ -70,7 +70,7 @@ static int OpenDevice( vlc_object_t *, access_sys_t *, std::string, bool );
 static ComPtr<IBaseFilter> FindCaptureDevice( vlc_object_t *, std::string *,
                                        std::list<std::string> *, bool );
 static size_t EnumDeviceCaps( vlc_object_t *, IBaseFilter *,
-                              int, int, int, int, int, int,
+                              vlc_fourcc_t, int, int, int, int, int,
                               AM_MEDIA_TYPE *mt, size_t, bool );
 static bool ConnectFilters( vlc_object_t *, access_sys_t *,
                             IBaseFilter *, CaptureFilter * );
@@ -332,7 +332,7 @@ struct dshow_stream_t
 
     } header;
 
-    int             i_fourcc;
+    vlc_fourcc_t    i_fourcc;
     es_out_id_t     *p_es;
 
     bool      b_pts;
@@ -964,7 +964,7 @@ static bool ConnectFilters( vlc_object_t *p_this, access_sys_t *p_sys,
 /*
  * get fourcc priority from arbitrary preference, the higher the better
  */
-static int GetFourCCPriority( int i_fourcc )
+static int GetFourCCPriority( vlc_fourcc_t i_fourcc )
 {
     switch( i_fourcc )
     {
@@ -1336,7 +1336,7 @@ FindCaptureDevice( vlc_object_t *p_this, std::string *p_devicename,
 }
 
 static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
-                              int i_fourcc, int i_width, int i_height,
+                              vlc_fourcc_t i_fourcc, int i_width, int i_height,
                               int i_channels, int i_samplespersec,
                               int i_bitspersample, AM_MEDIA_TYPE *mt,
                               size_t mt_max, bool b_audio )
@@ -1405,7 +1405,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
                     {
                         if( SUCCEEDED(pSC->GetStreamCaps(i, &p_mt, pSCC)) )
                         {
-                            int i_current_fourcc = GetFourCCFromMediaType( *p_mt );
+                            vlc_fourcc_t i_current_fourcc = GetFourCCFromMediaType( *p_mt );
                             int i_current_priority = GetFourCCPriority(i_current_fourcc);
 
                             if( (i_fourcc && (i_current_fourcc != i_fourcc))
@@ -1598,7 +1598,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
 
         while( p_enummt->Next( 1, &p_mt, NULL ) == S_OK )
         {
-            int i_current_fourcc = GetFourCCFromMediaType( *p_mt );
+            vlc_fourcc_t i_current_fourcc = GetFourCCFromMediaType( *p_mt );
             if( !b_audio && i_current_fourcc && p_mt->majortype == MEDIATYPE_Video
                 && p_mt->formattype == FORMAT_VideoInfo )
             {
@@ -1712,7 +1712,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
             {
                 // the first four bytes of subtype GUID contains the codec FOURCC
                 const char *pfcc = (char *)&p_mt->subtype;
-                int i_current_fourcc = VLC_FOURCC(pfcc[0], pfcc[1], pfcc[2], pfcc[3]);
+                vlc_fourcc_t i_current_fourcc = VLC_FOURCC(pfcc[0], pfcc[1], pfcc[2], pfcc[3]);
                 if( VLC_FOURCC('H','C','W','2') == i_current_fourcc
                  && p_mt->majortype == MEDIATYPE_Video && !b_audio )
                 {


=====================================
modules/access/dshow/filter.cpp
=====================================
@@ -98,9 +98,9 @@ HRESULT WINAPI CopyMediaType( AM_MEDIA_TYPE *pmtTarget,
     return S_OK;
 }
 
-int GetFourCCFromMediaType( const AM_MEDIA_TYPE &media_type )
+vlc_fourcc_t GetFourCCFromMediaType( const AM_MEDIA_TYPE &media_type )
 {
-    int i_fourcc = 0;
+    vlc_fourcc_t i_fourcc = 0;
 
     if( media_type.majortype == MEDIATYPE_Video )
     {
@@ -181,6 +181,11 @@ int GetFourCCFromMediaType( const AM_MEDIA_TYPE &media_type )
             else if( media_type.subtype == MEDIASUBTYPE_MJPG )
                 i_fourcc = VLC_CODEC_MJPG;
 
+            else if( media_type.subtype == MEDIASUBTYPE_H264 ||
+                     media_type.subtype == MEDIASUBTYPE_h264 ||
+                     media_type.subtype == MEDIASUBTYPE_x264 ||
+                     media_type.subtype == MEDIASUBTYPE_X264 )
+                i_fourcc = VLC_CODEC_H264;
         }
     }
     else if( media_type.majortype == MEDIATYPE_Audio )
@@ -507,7 +512,7 @@ STDMETHODIMP CapturePin::QueryAccept( const AM_MEDIA_TYPE *pmt )
         return S_FALSE;
     }
 
-    int i_fourcc = GetFourCCFromMediaType(*pmt);
+    vlc_fourcc_t i_fourcc = GetFourCCFromMediaType(*pmt);
     if( !i_fourcc )
     {
         msg_Dbg( p_input, "CapturePin::QueryAccept "


=====================================
modules/access/dshow/filter.h
=====================================
@@ -39,7 +39,7 @@ void WINAPI FreeMediaType( AM_MEDIA_TYPE& mt );
 HRESULT WINAPI CopyMediaType( AM_MEDIA_TYPE *pmtTarget,
                               const AM_MEDIA_TYPE *pmtSource );
 
-int GetFourCCFromMediaType(const AM_MEDIA_TYPE &media_type);
+vlc_fourcc_t GetFourCCFromMediaType(const AM_MEDIA_TYPE &media_type);
 
 /****************************************************************************
  * Declaration of our dummy directshow filter pin class



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/78786d082504304ce84d56c88ce6e7ef4354c887...562264243039ca5d4aac359e7a332842013d6bbc

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/78786d082504304ce84d56c88ce6e7ef4354c887...562264243039ca5d4aac359e7a332842013d6bbc
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list