Skip to content

G-API: oneVPL - Implement simple MFP demux provider with auto provider selector#20926

Closed
sivanov-work wants to merge 15 commits intoopencv:4.xfrom
sivanov-work:mfp_demux_provider
Closed

G-API: oneVPL - Implement simple MFP demux provider with auto provider selector#20926
sivanov-work wants to merge 15 commits intoopencv:4.xfrom
sivanov-work:mfp_demux_provider

Conversation

@sivanov-work
Copy link
Copy Markdown
Contributor

@sivanov-work sivanov-work commented Oct 22, 2021

Implement new media source provider by using Microsoft Media Foundation which carry out video stream demultiplexing.
IDataProvider updated and it responsible for getting CodecID based on its owning source data
Implemented DataProviderDispatcher which try on specific provider for oneVPL source based on cfg params and file format

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Build Configuration

force_builders=XCustom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

Xbuild_image:Custom=centos:7
Xbuildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

build_image:Custom=ubuntu-openvino-2021.3.0:20.04
Xbuild_image:Custom Win=openvino-2021.2.0
build_image:Custom Mac=openvino-2021.2.0

test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,python2,python3,java

buildworker:Custom=linux-1
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

build_image:Custom Win=gapi-onevpl-2021.6.0
buildworker:Custom Win=windows-3
build_contrib:Custom Win=OFF

#ifdef HAVE_ONEVPL
#ifdef _WIN32
#define NOMINMAX
#include <atlbase.h>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to remove

TEST(OneVPL_Source_MFP, decode_header)
{
using namespace cv::gapi::wip::onevpl;
MFPDemuxDataProvider provider("C:\\Users\\sivanov\\github\\opencv_extra\\testdata\\highgui\\video\\sample_322x242_15frames.yuv420p.libx264.mp4");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use checking for EXTRA availability

@sivanov-work sivanov-work marked this pull request as draft October 22, 2021 12:49
@sivanov-work sivanov-work marked this pull request as ready for review October 26, 2021 07:37
std::string reason;
};

struct GAPI_EXPORTS DataProviderUnsupportedException : public DataProviderException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need custom exception type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to catch & process provider-related error.
Current implementations of DataProviderDispatcher uses exception catching to select relevant provider impl: raw or demux

AV1,
JPEG,

UNCOMPRESSED = std::numeric_limits<uint16_t>::max()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me I don't get an idea of that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum class may be ABI unstable by adding another one enum item. so it chosen large enough and UNCOMPRESSES initialized as max value of underlyied type (uint16_t).
P.S. It is used for base value initializer for codecId member
P.P.S. Maybe it is more clear to rename it to LAST_VALUE or something like @TolyaTalamanov what do you think?


static const char *to_cstr(CodecID codec);

virtual ~IDataProvider() {};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=default

@sivanov-work sivanov-work changed the title G-API: oneVPL - [WIP] Implement MFP demux provider with auto provider selector G-API: oneVPL - Implement simple MFP demux provider with auto provider selector Oct 29, 2021
@sivanov-work
Copy link
Copy Markdown
Contributor Author

Closed because new Async Version of Demultiplexer was implemented in #21022
which reject some code changes are introduced by current PR

@sivanov-work sivanov-work deleted the mfp_demux_provider branch March 5, 2022 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants