Skip to content

Commit

Permalink
Fix h264 hardware decoding on jetpack 5.1.1 (#128)
Browse files Browse the repository at this point in the history
* Fix H264 decoder on Jetpac 5.1.1.

* Revert "Fix H264 decoder on Jetpac 5.1.1."

This reverts commit 32bb09c.

* Fix H264 decoder on Jetpac 5.1.1.

* Revert "Fix H264 decoder on Jetpac 5.1.1."

This reverts commit c3a8666.

* Fix H264 decoder on Jetpac 5.1.1.

* Revert "Fix H264 decoder on Jetpac 5.1.1."

This reverts commit 62a2d66.

* Fix H264 decoder on Jetpac 5.1.1.

* Fix H264 decoder on Jetpac 5.1.1.

* Bump the version
  • Loading branch information
mamaheux authored Sep 13, 2023
1 parent ee3de10 commit c92aa74
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.3
0.6.4
Original file line number Diff line number Diff line change
Expand Up @@ -294,18 +294,36 @@ GstCaps* GStreamerVideoDecoder::getCapsForFrame(const webrtc::EncodedImage& imag

if (!m_caps || lastWidth != m_width || lastHeight != m_height)
{
m_caps = gst::unique_from_ptr(gst_caps_new_simple(
m_mediaTypeCaps.c_str(),
"width",
G_TYPE_INT,
m_width,
"height",
G_TYPE_INT,
m_height,
"alignment",
G_TYPE_STRING,
"au",
nullptr));
if (m_mediaTypeCaps == "video/x-h264")
{
m_caps = gst::unique_from_ptr(gst_caps_new_simple(
m_mediaTypeCaps.c_str(),
"width",
G_TYPE_INT,
m_width,
"height",
G_TYPE_INT,
m_height,
"alignment",
G_TYPE_STRING,
"au",
"stream-format",
G_TYPE_STRING,
"byte-stream",
nullptr));
}
else
{
m_caps = gst::unique_from_ptr(gst_caps_new_simple(
m_mediaTypeCaps.c_str(),
"width",
G_TYPE_INT,
m_width,
"height",
G_TYPE_INT,
m_height,
nullptr));
}
}

return m_caps.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool VaapiH264GStreamerVideoDecoder::isHardwareAccelerated()


TegraH264GStreamerVideoDecoder::TegraH264GStreamerVideoDecoder()
: H264GStreamerVideoDecoder("h264parse ! nvv4l2decoder ! nvvidconv", true)
: H264GStreamerVideoDecoder("nvv4l2decoder ! nvvidconv", true)
{
}

Expand All @@ -100,8 +100,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 c92aa74

Please sign in to comment.