@@ -64,7 +64,6 @@ int32_t VideoReceiveAdapterImpl::AdapterDecoder::Decode(const webrtc::EncodedIma
64
64
{
65
65
RTC_DLOG (LS_VERBOSE) << " AdapterDecoder Decode" ;
66
66
owt_base::FrameFormat format = FRAME_FORMAT_UNKNOWN;
67
- bool notifyStats = false ;
68
67
69
68
switch (m_codec) {
70
69
case webrtc::VideoCodecType::kVideoCodecVP8 :
@@ -90,15 +89,20 @@ int32_t VideoReceiveAdapterImpl::AdapterDecoder::Decode(const webrtc::EncodedIma
90
89
RTC_DLOG (LS_INFO) << " AdapterDecoder increase buffer size: " << m_bufferSize;
91
90
}
92
91
92
+ if (encodedImage._encodedWidth > 0 && encodedImage._encodedHeight > 0 ) {
93
+ m_width = encodedImage._encodedWidth ;
94
+ m_height = encodedImage._encodedHeight ;
95
+ }
96
+
93
97
memcpy (m_frameBuffer.get (), encodedImage.data (), encodedImage.size ());
94
98
Frame frame;
95
99
memset (&frame, 0 , sizeof (frame));
96
100
frame.format = format;
97
101
frame.payload = m_frameBuffer.get ();
98
102
frame.length = encodedImage.size ();
99
103
frame.timeStamp = encodedImage.Timestamp ();
100
- frame.additionalInfo .video .width = encodedImage. _encodedWidth ;
101
- frame.additionalInfo .video .height = encodedImage. _encodedHeight ;
104
+ frame.additionalInfo .video .width = m_width ;
105
+ frame.additionalInfo .video .height = m_height ;
102
106
frame.additionalInfo .video .isKeyFrame = (encodedImage._frameType == webrtc::VideoFrameType::kVideoFrameKey );
103
107
104
108
if (m_parent) {
@@ -113,13 +117,11 @@ int32_t VideoReceiveAdapterImpl::AdapterDecoder::Decode(const webrtc::EncodedIma
113
117
m_parent->m_format = format;
114
118
statsChanged = true ;
115
119
}
116
- if (encodedImage._encodedWidth != 0 && encodedImage._encodedHeight != 0 ) {
117
- if ((m_parent->m_width != encodedImage._encodedWidth ) || (m_parent->m_height != encodedImage._encodedHeight )) {
118
- // Update width and height
119
- m_parent->m_width = encodedImage._encodedWidth ;
120
- m_parent->m_height = encodedImage._encodedHeight ;
121
- statsChanged = true ;
122
- }
120
+ if ((m_parent->m_width != m_width) || (m_parent->m_height != m_height)) {
121
+ // Update width and height
122
+ m_parent->m_width = m_width;
123
+ m_parent->m_height = m_height;
124
+ statsChanged = true ;
123
125
}
124
126
if (statsChanged) {
125
127
// Notify the stats
0 commit comments