Skip to content

Commit

Permalink
Fix H264 decoder on Jetpac 5.1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
mamaheux committed Sep 12, 2023
1 parent d70d12a commit 62a2d66
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ namespace opentera
class H264GStreamerVideoDecoder : public GStreamerVideoDecoder
{
public:
explicit H264GStreamerVideoDecoder(std::string decoderPipeline, bool resetPipelineOnSizeChanges = false);
explicit H264GStreamerVideoDecoder(
std::string decoderPipeline,
const char* mediaTypeCapsParameters = "",
bool resetPipelineOnSizeChanges = false);
~H264GStreamerVideoDecoder() override = default;

static const char* mediaTypeCaps();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@
using namespace opentera;
using namespace std;

H264GStreamerVideoDecoder::H264GStreamerVideoDecoder(string decoderPipeline, bool resetPipelineOnSizeChanges)
: GStreamerVideoDecoder(mediaTypeCaps(), move(decoderPipeline), resetPipelineOnSizeChanges)
H264GStreamerVideoDecoder::H264GStreamerVideoDecoder(
string decoderPipeline,
const char* mediaTypeCapsParameters,
bool resetPipelineOnSizeChanges)
: GStreamerVideoDecoder(
string(mediaTypeCaps()) + mediaTypeCapsParameters,
move(decoderPipeline),
resetPipelineOnSizeChanges)
{
}

Expand Down Expand Up @@ -86,7 +92,7 @@ bool VaapiH264GStreamerVideoDecoder::isHardwareAccelerated()


TegraH264GStreamerVideoDecoder::TegraH264GStreamerVideoDecoder()
: H264GStreamerVideoDecoder("h264parse ! nvv4l2decoder ! nvvidconv", true)
: H264GStreamerVideoDecoder("nvv4l2decoder ! nvvidconv", ",alignment=au,stream-format=byte-stream", true)
{
}

Expand All @@ -100,8 +106,8 @@ webrtc::VideoDecoder::DecoderInfo TegraH264GStreamerVideoDecoder::GetDecoderInfo

bool TegraH264GStreamerVideoDecoder::isSupported()
{
return gst::elementFactoryExists("x264enc") && gst::elementFactoryExists("h264parse") &&
gst::elementFactoryExists("nvv4l2decoder") && gst::elementFactoryExists("nvvidconv") &&
return gst::elementFactoryExists("x264enc") && gst::elementFactoryExists("nvv4l2decoder") &&
gst::elementFactoryExists("nvvidconv") &&
gst::testEncoderDecoderPipeline("x264enc ! nvv4l2decoder ! nvvidconv");
}

Expand Down

0 comments on commit 62a2d66

Please sign in to comment.