summaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
...
* va: sort the device queueHaihao Xiang2021-02-021-1/+10
| | | | | | | | If so, the elements will be registered per drm node in order of renderD128, renderD129, ... etc, an element with constant name will be registered on renderD128 on a hardware with multiple drm nodes. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1988>
* v4l2decoder: Small documentation fixSeungha Yang2021-02-021-5/+5
| | | | | | Fixing documentation even though those methods are v4l2codecs plugin internals Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2000>
* v4l2codecs: h264: Enable 1 frame delay on non-liveNicolas Dufresne2021-01-292-4/+27
| | | | | | | | When doing non-live decoding, enable 1 frame of delay. This will ensure that we queue the next decoding job before we actually wait for the previous to complete. This improves throughput notably on RK3399. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
* v4l2codecs: Add support for render delayNicolas Dufresne2021-01-292-3/+43
| | | | | | This add support for render delay in the decoder helper. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
* v4l2codecs: Coding style fixNicolas Dufresne2021-01-291-2/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
* v4l2codecs: Poll inside set_done()Nicolas Dufresne2021-01-294-32/+11
| | | | | | | This removes the need for the gst_v4l2_decoder_is_done() helper and simplify slightly the subclass code. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
* v4l2codecs: Make request structure ref-countedNicolas Dufresne2021-01-294-16/+46
| | | | | | | | | This adds a non-thread safe refcount to the GstV4l2Request. This will allow holding on more then one request in order to implement render delay. This is made non-thread safe for speed as we know this will all happen on the same streaming thread. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
* v4l2codecs: Rework handling of queues and pending requestsNicolas Dufresne2021-01-294-171/+235
| | | | | | | | | | | | | Starting from this patch, all queue and dequeue operation happening on V4L2 is now abstracted with the request. Buffers are dequeued automatically when pending requests are marked done and only 1 in-flight request is now used. Along with fixing issues with request not being reused with slice decoders, this change reduces the memory footprint by allocating only two bitstream buffers. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1881>
* decklink: Fixed decklinkvideosink auto format detectionStaz M2021-01-291-1/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1994>
* nvh264sldec: Add support for output-delay to improve throughput performanceSeungha Yang2021-01-291-0/+17
| | | | | | | | | NVDEC API support delaying getting decoded output, and recommended delay by API document is 4 frames. In case that throughput is more critical factor than latency, we can prefer delayed output as recommended by NVIDIA. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1925>
* d3d11videosink: Don't limit max buffers of buffer poolSeungha Yang2021-01-271-4/+5
| | | | | | | In some case, especially reverse playback, we would need more than two buffers. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1989>
* d3d11: Suppress some warning debug messagesSeungha Yang2021-01-271-1/+2
| | | | | | | | | | | | | | | * Don't warn for live object, since ID3D11Debug itself seems to be holding refcount of ID3D11Device at the moment we called ID3D11Debug::ReportLiveDeviceObjects(). It would report live object always * Device might not be able to support some formats (e.g., P010) especially in case of WARP device. We don't need to warn about that. * gst_d3d11_device_new() can be used for device enumeration. Don't warn even if we cannot create D3D11 device with given adapter index therefore. * Don't warn for HLSL compiler warning. It's just noise and should not be critical thing at all Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1986>
* d3d11videosink: Add support for drawing on application's own textureSeungha Yang2021-01-269-35/+1097
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a way to support drawing on application's texture instead of usual window handle. To make use of this new feature, application should follow below step. 1) Enable this feature by using "draw-on-shared-texture" property 2) Watch "begin-draw" signal 3) On "begin-draw" signal handler, application can request drawing by using "draw" signal action. Note that "draw" signal action should be happen before "begin-draw" signal handler is returned NOTE 1) For texture sharing, creating a texture with D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag is strongly recommend if possible because we cannot ensure sync a texture which was created with D3D11_RESOURCE_MISC_SHARED and it would cause glitch with ID3D11VideoProcessor use case. NOTE 2) Direct9Ex doesn't support texture sharing which was created with D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX. In other words, D3D11_RESOURCE_MISC_SHARED is the only option for Direct3D11/Direct9Ex interop. NOTE 3) Because of missing synchronization around ID3D11VideoProcessor, If shared texture was created with D3D11_RESOURCE_MISC_SHARED, d3d11videosink might use fallback texture to convert DXVA texture to normal Direct3D texture. Then converted texture will be copied to user-provided shared texture. * Why not use generic appsink approach? In order for application to be able to store video data which was produced by GStreamer in application's own texture, there would be two possible approaches, one is copying our texture into application's own texture, and the other is drawing on application's own texture directly. The former (appsink way) cannot be a zero-copy by nature. In order to support zero-copy processing, we need to draw on application's own texture directly. For example, assume that application wants RGBA texture. Then we can imagine following case. "d3d11h264dec ! d3d11convert ! video/x-raw(memory:D3D11Memory),format=RGBA ! appsink" ^ |_ allocate new Direct3D texture for RGBA format In above case, d3d11convert will allocate new texture(s) for RGBA format and then application will copy again the our RGBA texutre into application's own texture. One texture allocation plus per frame GPU copy will hanppen in that case therefore. Moreover, in order for application to be able to access our texture, we need to allocate texture with additional flags for application's Direct3D11 device to be able to read texture data. That would be another implementation burden on our side But with this MR, we can configure pipeline in this way "d3d11h264dec ! d3d11videosink". In that way, we can save at least one texture allocation and per frame texutre copy since d3d11videosink will convert incoming texture into application's texture format directly without copy. * What if we expose texture without conversion and application does conversion by itself? As mentioned above, for application to be able to access our texture from application's Direct3D11 device, we need to allocate texture in a special form. But in some case, that might not be possible. Also, if a texture belongs to decoder DPB, exposing such texture to application is unsafe and usual Direct3D11 shader cannot handle such texture. To convert format, ID3D11VideoProcessor API needs to be used but that would be a implementation burden for application. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1873>
* d3d11: Add support for MPEG-2 video decodingSeungha Yang2021-01-256-0/+1075
| | | | | | Add DXVA/Direct3D11 API based MPEG-2 decoder element Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1969>
* va: filter: fix assignation to proper variableVíctor Manuel Jáquez Leal2021-01-221-1/+1
| | | | | | | Fix the result of a wrong copy&paste Fixes: #1501 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1976>
* mfvideoenc: Add support for P010 d3d11 textureSeungha Yang2021-01-211-6/+24
| | | | | | Add P010 Direct3D11 texture format support Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1970>
* d3d11: Don't use hardcoded maximum resolution valueSeungha Yang2021-01-2011-209/+271
| | | | | | | | Maximum supported texture dimension is pre-defined based on feature level and it couldn't be INT_MAX in any case. See also https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-devices-downlevel-intro Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1964>
* d3d11videosink: Fix ugly thread name for Win32 window impl.Seungha Yang2021-01-191-1/+1
| | | | | | Don't need to put Win32 twice Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1962>
* d3d11videosink: Fix MSVC build warnings around UWP codeSeungha Yang2021-01-192-6/+0
| | | | | | | | | | | gstd3d11window_corewindow.cpp(408): warning C4189: 'storage': local variable is initialized but not referenced gstd3d11window_corewindow.cpp(490): warning C4189: 'self': local variable is initialized but not referenced gstd3d11window_swapchainpanel.cpp(481): warning C4189: 'self': local variable is initialized but not referenced Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1962>
* d3d11: Allow building UWP features with Desktop features if possibleSeungha Yang2021-01-193-8/+15
| | | | | | | | WINAPI_PARTITION_DESKTOP and WINAPI_PARTITION_APP can coexist. Although UWP only binaries should be used for production stage, this change will be useful for development stage Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1962>
* d3d11decoder: Do more retry for ID3D11VideoContext::DecoderBeginFrame failureSeungha Yang2021-01-181-6/+10
| | | | | | | | | Some GPUs (especially NVIDIA) are complaining that GPU is still busy even we did 50 times of retry with 1ms sleep per failure. Because DXVA/D3D11 doesn't provide API for "GPU-IS-READY-TO-DECODE" like signal, there seems to be still no better solution other than sleep. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1913>
* d3d11videosink: Fix build error on UWPSeungha Yang2021-01-181-1/+1
| | | | | | gstd3d11videosink.c(662): error C2065: 'sink': undeclared identifier Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1961>
* va: Fix some gst_object_unref error because the pointer is NULL.He Junyan2021-01-172-9/+11
| | | | | | | !1957 introduces some error of gst_object_unref for NULL pointer. Fixes all of them. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1959>
* va: Make the caps pointer operation atomic in vadecoder.He Junyan2021-01-151-2/+2
| | | | | | | The vadecoder's srcpad_caps and sinkpad_caps pointers are outside of the mutex protection. Just make all operation for them atomic. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1957>
* va: Fix a latent race condition in vabasedec.He Junyan2021-01-152-19/+58
| | | | | | | | | | | The vabasedec's display and decoder are created/destroyed between the gst_va_base_dec_open/close pair. All the data and event handling functions are between this pair and so the accessing to these pointers are safe. But the query function can be called anytime. So we need to: 1. Make these pointers operation in open/close and query atomic. 2. Hold an extra ref during query function to avoid it destroyed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1957>
* decklinkaudiosrc: Allow disabling audio sample alignment code by setting the ↵Sebastian Dröge2021-01-141-1/+5
| | | | | | | | | alignment-threshold to 0 And handle setting it to GST_CLOCK_TIME_NONE as always aligning without ever detecting a discont. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1956>
* mfvideoenc: Add support for Direct3D11 textureSeungha Yang2021-01-1312-158/+1129
| | | | | | | | | | | | | | | | | | | | | | | Initial support for d3d11 texture so that encoder can copy upstream d3d11 texture into encoder's own texture pool without downloading memory. This implementation requires MFTEnum2() API for creating MFT (Media Foundation Transform) object for specific GPU but the API is Windows 10 desktop only. So UWP is not target of this change. See also https://docs.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mftenum2 Note that, for MF plugin to be able to support old OS versions without breakage, this commit will load MFTEnum2() symbol by using g_module_open() Summary of required system environment: - Needs Windows 10 (probably at least RS 1 update) - GPU should support ExtendedNV12SharedTextureSupported feature - Desktop application only (UWP is not supported yet) Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1903>
* d3d11: Move core methods to gst-libsSeungha Yang2021-01-1351-4806/+690
| | | | | | | | | | | | Move d3d11 device, memory, buffer pool and minimal method to gst-libs so that other plugins can access d3d11 resource. Since Direct3D is primary graphics API on Windows, we need this infrastructure for various plugins can share GPU resource without downloading GPU memory. Note that this implementation is public only for -bad scope for now. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/464>
* va: allocator: Fix deadlock caused by double lockSeungha Yang2021-01-121-2/+2
| | | | | | Trivial bug fix for deadlock Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1949>
* meson: va: Skip configuration on non-linux environmentSeungha Yang2021-01-071-1/+2
| | | | | | | | VA plugin is linux-only plugin, so we can skip it earlier. Note that this plugin is making use of libdrm meson fallback, which is unusable on the other platforms such as Windows Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1946>
* msdkenc: the unit for max-frame-size is kbyteHaihao Xiang2021-01-071-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1944>
* va: mpeg2dec: refactor the picture reference fillingVíctor Manuel Jáquez Leal2021-01-061-29/+38
| | | | | | | | | | | | | | | | Add the helper function _get_surface_id() which extracts the VASurfaceID from the passed picture. This function gets the surface of the next and previous reference picture. Instead of if-statements, this refactor uses a switch-statement with a fall-through, for P-type pictures, making the code a bit more readable. Also it adds quirks for gallium driver, which cannot handle invalid surfaces as forwarding nor backwarding references, so the function fails. Also iHD cannot handle them, but to avoid failing, the current picture is used as self-reference. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1939>
* va: mpeg2dec: set first field either frame or has a first fieldVíctor Manuel Jáquez Leal2021-01-061-1/+9
| | | | | | | | Add a helper function _is_frame_start() which check if picture has a frame structure or if it has not an interlaced first field yet. This function is used with filling is_first_field parameter. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1939>
* va: display: parse and set driver implementationVíctor Manuel Jáquez Leal2021-01-052-10/+64
| | | | | | | | This enum can be used for quirk handling. It's not a property because the driver enum list might change, it's not static, thus avoiding the update of GType declaration. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1938>
* va: display: add function precondition checkVíctor Manuel Jáquez Leal2021-01-052-2/+6
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1938>
* va: mpeg2dec: Using the current picture's surface when missing reference.He Junyan2021-01-041-2/+6
| | | | | | | | | | | | | | | | | | | | When missing the reference frames, we should not just discard the current frame. Some streams have group of picture header. It is an optional header that can be used immediately before a coded I-frame to indicate to the decoder if the first consecutive B-pictures immediately following the coded I-frame can be reconstructed properly in the case of a random access. In that case, the B frames may miss the previous reference and can still be correctly decoded. We also notice that the second field of the I frame may be set to P type, and it only ref its first field. We should not skip all those frames, and even the frame really misses the reference frame, some manner such as inserting grey picture should be used to handle these cases. The driver crashes when it needs to access the reference picture while we set forward_reference_picture or backward_reference_picture to VA_INVALID_ID. We now set it to current picture to avoid this. This is just a temp manner. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
* va: mpeg2dec: Apply buffer_flags to the output buffer.He Junyan2021-01-041-0/+11
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
* msdkenc{h264,h265}: add min-qp and max-qp propertiesHaihao Xiang2020-12-304-0/+77
| | | | | | | | | The SDK allows user to set a QP range [1], so add min-qp and max-qp to sepecify QP range. By default, there is no limitations on QP. [1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxextcodingoption2 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
* msdkenc{h264,h265}: add p-pyramid propertyHaihao Xiang2020-12-304-0/+50
| | | | | | | | | The SDK can support P-Pyramid reference structure [1], so add a new property to enable this feature in msdkenc{h264,h265}. [1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#preftype Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
* msdkh265enc: add b-pyramid propertyHaihao Xiang2020-12-302-0/+24
| | | | | | | Like as msdkh264enc, b-pyramid is added to enable B-Pyramid reference structure for H265 encoding Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
* msdkh265enc: add transform-skip propertyHaihao Xiang2020-12-304-0/+49
| | | | | | | | | Since the SDK API 1.26, TransformSkip was added to control transform_skip_enabled_flag setting in PPS [1] [1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxextcodingoption3 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1908>
* msdk: needn't close mfx session when failedHaihao Xiang2020-12-301-1/+0
| | | | | | | | | Otherwise we will get double free issue because mfx session is closed in finalize. See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1867#note_739346 for the double free issue. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1916>
* d3d11compositor: Add support for resolution changeSeungha Yang2020-12-281-1/+25
| | | | | | | | Not only for position update (e.g., xpos, ypos), we need to configure shader again per resolution change of each input stream. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1912>
* d3d11shader: Fix ID3DBlob object leakSeungha Yang2020-12-281-0/+7
| | | | | | | | Even if HLSL compiler was able to compile our shader code, D3DCompile() might return ID3DBlob object for compile warnings and the object should be released. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1914>
* va: mpeg2dec: cosmetic changesVíctor Manuel Jáquez Leal2020-12-281-36/+24
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1798>
* va: Add mpeg2 VA decoder.He Junyan2020-12-286-1/+764
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1798>
* mfvideoenc: Re-define default GOP size valueSeungha Yang2020-12-275-30/+90
| | | | | | | | | | | | | | | | | | The behavior for zero AVEncMPVGOPSize value would be varying depending on GPU vendor implementation and some GPU will produce keyframe only once at the beginning of encoding. That's unlikely expected result for users. To make this property behave consistently among various GPUs, this commit will change default value of "gop-size" property to -1 which means "auto". When "gop-size" is unspecified, then mfvideoenc will calculate GOP size based on framerate like that of our x264enc implementation. See also https://docs.microsoft.com/en-us/windows/win32/directshow/avencmpvgopsize-property Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1911>
* mfvideoenc: Fix use of uninitialized valueSeungha Yang2020-12-271-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1911>
* d3d11device: Add property for getting adapter LUIDSeungha Yang2020-12-262-3/+19
| | | | | | | | | | LUID (Locally Unique Identifier) can used for identifying GPU and that's required for some Windows APIs (e.g., MFTEnum2()) to setup device. See also https://docs.microsoft.com/en-us/windows/win32/api/mfapi/nf-mfapi-mftenum2 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1910>
* mfvideoenc: Remove duplicated class registration codeSeungha Yang2020-12-266-1170/+536
| | | | | | | | Each codec subclass has the same code for class/element registration, so we can move the code into one helper methodm and that will make future enhancement simple. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1909>