@@ -155,6 +155,11 @@ int32_t AMFVideoDecoderImpl::Decode(const webrtc::EncodedImage& input_image,
155155 // queue is full; sleep, try to get ready surfaces in polling thread and repeat submission
156156 amf_sleep (1 );
157157 continue ;
158+ } else if (res == AMF_RESOLUTION_CHANGED || res == AMF_RESOLUTION_UPDATED ) {
159+ // デコードするサイズが変わったらデコーダを作り直す
160+ ReleaseAMF ();
161+ InitAMF ();
162+ continue ;
158163 } else {
159164 RETURN_IF_FAILED (res, L" Failed to SubmitInput()" );
160165 break ;
@@ -182,12 +187,17 @@ AMF_RESULT AMFVideoDecoderImpl::ProcessSurface(amf::AMFSurfacePtr surface) {
182187 RETURN_IF_FAILED (res, " Failed to Convert()" );
183188
184189 uint32_t pts = surface->GetPts ();
185- RTC_LOG (LS_ERROR ) << " pts=" << pts;
186190
187191 auto py = surface->GetPlane (amf::AMF_PLANE_Y );
188192 auto pu = surface->GetPlane (amf::AMF_PLANE_U );
189193 auto pv = surface->GetPlane (amf::AMF_PLANE_V );
190194
195+ // RTC_LOG(LS_ERROR) << "AMFVideoDecoderImpl::ProcessSurface: "
196+ // << "pts=" << pts << ", width=" << py->GetWidth()
197+ // << ", height=" << py->GetHeight()
198+ // << ", pitch_y=" << py->GetHPitch()
199+ // << ", pitch_u=" << pu->GetHPitch()
200+ // << ", pitch_v=" << pv->GetHPitch();
191201 webrtc::scoped_refptr<webrtc::I420Buffer> i420_buffer =
192202 buffer_pool_.CreateI420Buffer (py->GetWidth (), py->GetHeight ());
193203 libyuv::I420Copy ((const uint8_t *)py->GetNative (), py->GetHPitch (),
0 commit comments