Changeset 237800 in webkit
- Timestamp:
- Nov 5, 2018, 7:05:39 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r237799 r237800 1 2018-11-05 Thibault Saunier <tsaunier@igalia.com> 2 3 [GStreamer][WebRTC] properly mark H.264 stream type in the "decoder" 4 https://bugs.webkit.org/show_bug.cgi?id=190676 5 6 Reviewed by Philippe Normand. 7 8 Avoiding to have h264parse make assumption (which might be wrong at some 9 point). 10 11 * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: 12 (WebCore::GStreamerVideoDecoder::GetCapsForFrame): 13 1 14 2018-11-05 Thibault Saunier <tsaunier@igalia.com> 2 15 -
trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp
r237075 r237800 75 75 } 76 76 77 int32_t InitDecode(const webrtc::VideoCodec*, int32_t) 77 int32_t InitDecode(const webrtc::VideoCodec*, int32_t) override 78 78 { 79 79 m_src = makeElement("appsrc"); … … 183 183 } 184 184 185 GstCaps* GetCapsForFrame(const webrtc::EncodedImage& image)185 virtual GstCaps* GetCapsForFrame(const webrtc::EncodedImage& image) 186 186 { 187 187 if (!m_caps) { … … 276 276 public: 277 277 H264Decoder() { } 278 279 int32_t InitDecode(const webrtc::VideoCodec* codecInfo, int32_t nCores) final 280 { 281 if (codecInfo && codecInfo->codecType != webrtc::kVideoCodecH264) 282 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; 283 284 m_profile = nullptr; 285 if (codecInfo) { 286 auto h264Info = codecInfo->H264(); 287 288 switch (h264Info.profile) { 289 case webrtc::H264::kProfileConstrainedBaseline: 290 m_profile = "constrained-baseline"; 291 break; 292 case webrtc::H264::kProfileBaseline: 293 m_profile = "baseline"; 294 break; 295 case webrtc::H264::kProfileMain: 296 m_profile = "main"; 297 break; 298 case webrtc::H264::kProfileConstrainedHigh: 299 m_profile = "constrained-high"; 300 break; 301 case webrtc::H264::kProfileHigh: 302 m_profile = "high"; 303 break; 304 } 305 } 306 307 return GStreamerVideoDecoder::InitDecode(codecInfo, nCores); 308 } 309 310 GstCaps* GetCapsForFrame(const webrtc::EncodedImage& image) final 311 { 312 if (!m_caps) { 313 m_caps = adoptGRef(gst_caps_new_simple(Caps(), 314 "width", G_TYPE_INT, image._encodedWidth, 315 "height", G_TYPE_INT, image._encodedHeight, 316 "profile", G_TYPE_STRING, m_profile ? m_profile : "baseline", 317 "stream-format", G_TYPE_STRING, "byte-stream", 318 "alignment", G_TYPE_STRING, "au", 319 nullptr)); 320 } 321 322 return m_caps.get(); 323 } 278 324 const gchar* Caps() final { return "video/x-h264"; } 279 325 const gchar* Name() final { return cricket::kH264CodecName; } 280 326 webrtc::VideoCodecType CodecType() final { return webrtc::kVideoCodecH264; } 327 328 private: 329 const gchar* m_profile; 281 330 }; 282 331
Note:
See TracChangeset
for help on using the changeset viewer.