|
| 1 | +From 2dbf35985d047749b0396d960864f21240d1e2b0 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Jianhui Dai < [email protected]> |
| 3 | +Date: Wed, 30 Sep 2020 13:08:08 +0800 |
| 4 | +Subject: [PATCH] Implement FOV RTCP feedback |
| 5 | + |
| 6 | +--- |
| 7 | + .../sdk/base/customizedvideodecoderproxy.cc | 21 ++++++++++++++++++- |
| 8 | + .../cpp/owt/base/videodecoderinterface.h | 10 +++++++++ |
| 9 | + 2 files changed, 30 insertions(+), 1 deletion(-) |
| 10 | + |
| 11 | +diff --git a/talk/owt/sdk/base/customizedvideodecoderproxy.cc b/talk/owt/sdk/base/customizedvideodecoderproxy.cc |
| 12 | +index 6fef4ee..f2ba857 100644 |
| 13 | +--- a/talk/owt/sdk/base/customizedvideodecoderproxy.cc |
| 14 | ++++ b/talk/owt/sdk/base/customizedvideodecoderproxy.cc |
| 15 | +@@ -9,7 +9,9 @@ namespace base { |
| 16 | + |
| 17 | + CustomizedVideoDecoderProxy::CustomizedVideoDecoderProxy(VideoCodecType type, |
| 18 | + VideoDecoderInterface* external_video_decoder) |
| 19 | +- : codec_type_(type), decoded_image_callback_(nullptr), external_decoder_(external_video_decoder) {} |
| 20 | ++ : codec_type_(type), decoded_image_callback_(nullptr), external_decoder_(external_video_decoder) { |
| 21 | ++ external_decoder_->SetCustomizedVideoDecoderProxy(this); |
| 22 | ++ } |
| 23 | + |
| 24 | + CustomizedVideoDecoderProxy::~CustomizedVideoDecoderProxy() { |
| 25 | + if (external_decoder_) { |
| 26 | +@@ -88,5 +90,22 @@ CustomizedVideoDecoderProxy::Create(VideoCodecType type, |
| 27 | + VideoDecoderInterface* external_video_decoder) { |
| 28 | + return absl::make_unique<CustomizedVideoDecoderProxy>(type, external_video_decoder); |
| 29 | + } |
| 30 | ++ |
| 31 | ++void VideoDecoderInterface::SetCustomizedVideoDecoderProxy(void *customized_video_decoder_proxy) |
| 32 | ++{ |
| 33 | ++ customized_video_decoder_proxy_ = customized_video_decoder_proxy; |
| 34 | ++} |
| 35 | ++ |
| 36 | ++void *VideoDecoderInterface::GetCustomizedVideoDecoderProxy(void) |
| 37 | ++{ |
| 38 | ++ return customized_video_decoder_proxy_; |
| 39 | ++} |
| 40 | ++ |
| 41 | ++void VideoDecoderInterface::SendFOVFeedback(uint16_t yaw, uint16_t pitch) |
| 42 | ++{ |
| 43 | ++ if (customized_video_decoder_proxy_) |
| 44 | ++ static_cast<CustomizedVideoDecoderProxy *>(customized_video_decoder_proxy_)->SendFOVFeedback(yaw, pitch); |
| 45 | ++} |
| 46 | ++ |
| 47 | + } |
| 48 | + } |
| 49 | +diff --git a/talk/owt/sdk/include/cpp/owt/base/videodecoderinterface.h b/talk/owt/sdk/include/cpp/owt/base/videodecoderinterface.h |
| 50 | +index dced0fe..02cc35b 100644 |
| 51 | +--- a/talk/owt/sdk/include/cpp/owt/base/videodecoderinterface.h |
| 52 | ++++ b/talk/owt/sdk/include/cpp/owt/base/videodecoderinterface.h |
| 53 | +@@ -26,6 +26,8 @@ struct VideoEncodedFrame { |
| 54 | + */ |
| 55 | + class VideoDecoderInterface { |
| 56 | + public: |
| 57 | ++ VideoDecoderInterface() : customized_video_decoder_proxy_(nullptr) {} |
| 58 | ++ |
| 59 | + /** |
| 60 | + @brief Destructor |
| 61 | + */ |
| 62 | +@@ -51,6 +53,14 @@ class VideoDecoderInterface { |
| 63 | + @brief This function generates the customized decoder for each peer connection |
| 64 | + */ |
| 65 | + virtual VideoDecoderInterface* Copy() = 0; |
| 66 | ++ |
| 67 | ++ void SetCustomizedVideoDecoderProxy(void *customized_video_decoder_proxy); |
| 68 | ++ void *GetCustomizedVideoDecoderProxy(void); |
| 69 | ++ |
| 70 | ++ void SendFOVFeedback(uint16_t yaw, uint16_t pitch); |
| 71 | ++ |
| 72 | ++ private: |
| 73 | ++ void *customized_video_decoder_proxy_; |
| 74 | + }; |
| 75 | + } |
| 76 | + } |
| 77 | +-- |
| 78 | +2.17.1 |
| 79 | + |
0 commit comments