[vlc-commits] [Git][videolan/vlc][master] 3 commits: picture: remove VLC_VIDEO_CONTEXT_NONE

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sat Jan 15 09:50:41 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
7f425a69 by Steve Lhomme at 2022-01-15T09:27:45+00:00
picture: remove VLC_VIDEO_CONTEXT_NONE

Instead of letting people create a context for this type and assert, just don't
provide the feature.

Now we can assume no vctx = software picture.

- - - - -
c76f3a5b by Steve Lhomme at 2022-01-15T09:27:45+00:00
picture: document which structure type correspond to a video context type

VLC_VIDEO_CONTEXT_VDPAU set to empty as it will be after !1203

- - - - -
39fdcf2b by Steve Lhomme at 2022-01-15T09:27:45+00:00
picture: VLC_VIDEO_CONTEXT_VAAPI can also be empty

See vlc_vaapi_OpenChroma().

This makes vlc_vaapi_PicGetDisplay() and vlc_vaapi_PicGetSurface() only safe to
be used with pictures coming from the decoder.

- - - - -


2 changed files:

- include/vlc_picture.h
- src/input/decoder_helpers.c


Changes:

=====================================
include/vlc_picture.h
=====================================
@@ -90,15 +90,14 @@ struct vlc_video_context_operations
 /** Decoder device type */
 enum vlc_video_context_type
 {
-    VLC_VIDEO_CONTEXT_NONE,
-    VLC_VIDEO_CONTEXT_VAAPI,
-    VLC_VIDEO_CONTEXT_VDPAU,
-    VLC_VIDEO_CONTEXT_DXVA2, /**< private: d3d9_video_context_t* */
-    VLC_VIDEO_CONTEXT_D3D11VA,  /**< private: d3d11_video_context_t* */
-    VLC_VIDEO_CONTEXT_AWINDOW, /**< private: android_video_context_t* */
-    VLC_VIDEO_CONTEXT_NVDEC,
-    VLC_VIDEO_CONTEXT_CVPX,
-    VLC_VIDEO_CONTEXT_MMAL,
+    VLC_VIDEO_CONTEXT_VAAPI = 1, //!< private: vaapi_vctx* or empty
+    VLC_VIDEO_CONTEXT_VDPAU,     //!< empty
+    VLC_VIDEO_CONTEXT_DXVA2,     //!< private: d3d9_video_context_t*
+    VLC_VIDEO_CONTEXT_D3D11VA,   //!< private: d3d11_video_context_t*
+    VLC_VIDEO_CONTEXT_AWINDOW,   //!< private: android_video_context_t*
+    VLC_VIDEO_CONTEXT_NVDEC,     //!< empty
+    VLC_VIDEO_CONTEXT_CVPX,      //!< private: cvpx_video_context*
+    VLC_VIDEO_CONTEXT_MMAL,      //!< empty
 };
 
 VLC_API vlc_video_context * vlc_video_context_Create(vlc_decoder_device *,


=====================================
src/input/decoder_helpers.c
=====================================
@@ -240,7 +240,7 @@ vlc_video_context * vlc_video_context_Create(vlc_decoder_device *device,
                                           size_t private_size,
                                           const struct vlc_video_context_operations *ops)
 {
-    assert(private_type != VLC_VIDEO_CONTEXT_NONE); // use a NULL video context for that
+    assert(private_type != 0);
     vlc_video_context *vctx = malloc(sizeof(*vctx) + private_size);
     if (unlikely(vctx == NULL))
         return NULL;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/658ee05f78e475fde7da07e21b1522200b970863...39fdcf2b8d00bd84e7325011efd1708cbe2474a5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/658ee05f78e475fde7da07e21b1522200b970863...39fdcf2b8d00bd84e7325011efd1708cbe2474a5
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list