OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/gpu/android_video_decode_accelerator.h" | 5 #include "media/gpu/android_video_decode_accelerator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator( | 225 AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator( |
226 const MakeGLContextCurrentCallback& make_context_current_cb, | 226 const MakeGLContextCurrentCallback& make_context_current_cb, |
227 const GetGLES2DecoderCallback& get_gles2_decoder_cb) | 227 const GetGLES2DecoderCallback& get_gles2_decoder_cb) |
228 : client_(NULL), | 228 : client_(NULL), |
229 make_context_current_cb_(make_context_current_cb), | 229 make_context_current_cb_(make_context_current_cb), |
230 get_gles2_decoder_cb_(get_gles2_decoder_cb), | 230 get_gles2_decoder_cb_(get_gles2_decoder_cb), |
231 state_(NO_ERROR), | 231 state_(NO_ERROR), |
232 picturebuffers_requested_(false), | 232 picturebuffers_requested_(false), |
233 picture_buffer_manager_(this), | 233 picture_buffer_manager_(this), |
234 drain_type_(DRAIN_TYPE_NONE), | |
235 media_drm_bridge_cdm_context_(nullptr), | 234 media_drm_bridge_cdm_context_(nullptr), |
236 cdm_registration_id_(0), | 235 cdm_registration_id_(0), |
237 pending_input_buf_index_(-1), | 236 pending_input_buf_index_(-1), |
238 deferred_initialization_pending_(false), | 237 deferred_initialization_pending_(false), |
239 codec_needs_reset_(false), | 238 codec_needs_reset_(false), |
240 defer_surface_creation_(false), | 239 defer_surface_creation_(false), |
241 weak_this_factory_(this) {} | 240 weak_this_factory_(this) {} |
242 | 241 |
243 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() { | 242 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() { |
244 DCHECK(thread_checker_.CalledOnValidThread()); | 243 DCHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 MediaCodecStatus status = media_codec_->DequeueOutputBuffer( | 585 MediaCodecStatus status = media_codec_->DequeueOutputBuffer( |
587 NoWaitTimeOut, &buf_index, &offset, &size, &presentation_timestamp, | 586 NoWaitTimeOut, &buf_index, &offset, &size, &presentation_timestamp, |
588 &eos, NULL); | 587 &eos, NULL); |
589 TRACE_EVENT_END2("media", "AVDA::DequeueOutput", "status", status, | 588 TRACE_EVENT_END2("media", "AVDA::DequeueOutput", "status", status, |
590 "presentation_timestamp (ms)", | 589 "presentation_timestamp (ms)", |
591 presentation_timestamp.InMilliseconds()); | 590 presentation_timestamp.InMilliseconds()); |
592 | 591 |
593 switch (status) { | 592 switch (status) { |
594 case MEDIA_CODEC_ERROR: | 593 case MEDIA_CODEC_ERROR: |
595 // Do not post an error if we are draining for reset and destroy. | 594 // Do not post an error if we are draining for reset and destroy. |
596 // Instead, run the drain completion task. | 595 // Instead, signal completion of the drain. |
597 if (IsDrainingForResetOrDestroy()) { | 596 if (IsDrainingForResetOrDestroy()) { |
598 DVLOG(1) << __func__ << ": error while codec draining"; | 597 DVLOG(1) << __func__ << ": error while draining"; |
599 state_ = ERROR; | 598 state_ = ERROR; |
600 OnDrainCompleted(); | 599 OnDrainCompleted(); |
601 } else { | 600 } else { |
602 NOTIFY_ERROR(PLATFORM_FAILURE, "DequeueOutputBuffer failed."); | 601 NOTIFY_ERROR(PLATFORM_FAILURE, "DequeueOutputBuffer failed."); |
603 } | 602 } |
604 return false; | 603 return false; |
605 | 604 |
606 case MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER: | 605 case MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER: |
607 return false; | 606 return false; |
608 | 607 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 | 763 |
765 if (defer_surface_creation_ && !InitializePictureBufferManager()) { | 764 if (defer_surface_creation_ && !InitializePictureBufferManager()) { |
766 NOTIFY_ERROR(PLATFORM_FAILURE, | 765 NOTIFY_ERROR(PLATFORM_FAILURE, |
767 "Failed deferred surface and MediaCodec initialization."); | 766 "Failed deferred surface and MediaCodec initialization."); |
768 return; | 767 return; |
769 } | 768 } |
770 | 769 |
771 // If we previously deferred a codec restart, take care of it now. This can | 770 // If we previously deferred a codec restart, take care of it now. This can |
772 // happen on older devices where configuration changes require a codec reset. | 771 // happen on older devices where configuration changes require a codec reset. |
773 if (codec_needs_reset_) { | 772 if (codec_needs_reset_) { |
774 DCHECK_EQ(drain_type_, DRAIN_TYPE_NONE); | 773 DCHECK(!drain_type_); |
775 ResetCodecState(); | 774 ResetCodecState(); |
776 } | 775 } |
777 | 776 |
778 if (bitstream_buffer.id() >= 0 && bitstream_buffer.size() > 0) { | 777 if (bitstream_buffer.id() >= 0 && bitstream_buffer.size() > 0) { |
779 DecodeBuffer(bitstream_buffer); | 778 DecodeBuffer(bitstream_buffer); |
780 return; | 779 return; |
781 } | 780 } |
782 | 781 |
783 if (base::SharedMemory::IsHandleValid(bitstream_buffer.handle())) | 782 if (base::SharedMemory::IsHandleValid(bitstream_buffer.handle())) |
784 base::SharedMemory::CloseHandle(bitstream_buffer.handle()); | 783 base::SharedMemory::CloseHandle(bitstream_buffer.handle()); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 return; | 856 return; |
858 } | 857 } |
859 | 858 |
860 picture_buffer_manager_.ReuseOnePictureBuffer(it->second); | 859 picture_buffer_manager_.ReuseOnePictureBuffer(it->second); |
861 DoIOTask(true); | 860 DoIOTask(true); |
862 } | 861 } |
863 | 862 |
864 void AndroidVideoDecodeAccelerator::Flush() { | 863 void AndroidVideoDecodeAccelerator::Flush() { |
865 DVLOG(1) << __func__; | 864 DVLOG(1) << __func__; |
866 DCHECK(thread_checker_.CalledOnValidThread()); | 865 DCHECK(thread_checker_.CalledOnValidThread()); |
867 | 866 StartCodecDrain(DRAIN_FOR_FLUSH); |
868 if (state_ == SURFACE_DESTROYED || defer_surface_creation_) | |
869 NotifyFlushDone(); | |
870 else | |
871 StartCodecDrain(DRAIN_FOR_FLUSH); | |
872 } | 867 } |
873 | 868 |
874 void AndroidVideoDecodeAccelerator::ConfigureMediaCodecAsynchronously() { | 869 void AndroidVideoDecodeAccelerator::ConfigureMediaCodecAsynchronously() { |
875 DCHECK(thread_checker_.CalledOnValidThread()); | 870 DCHECK(thread_checker_.CalledOnValidThread()); |
876 | 871 |
877 DCHECK_NE(state_, WAITING_FOR_CODEC); | 872 DCHECK_NE(state_, WAITING_FOR_CODEC); |
878 state_ = WAITING_FOR_CODEC; | 873 state_ = WAITING_FOR_CODEC; |
879 | 874 |
880 if (media_codec_) { | 875 if (media_codec_) { |
881 AVDACodecAllocator::Instance()->ReleaseMediaCodec( | 876 AVDACodecAllocator::Instance()->ReleaseMediaCodec( |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 | 950 |
956 state_ = NO_ERROR; | 951 state_ = NO_ERROR; |
957 | 952 |
958 ManageTimer(true); | 953 ManageTimer(true); |
959 } | 954 } |
960 | 955 |
961 void AndroidVideoDecodeAccelerator::StartCodecDrain(DrainType drain_type) { | 956 void AndroidVideoDecodeAccelerator::StartCodecDrain(DrainType drain_type) { |
962 DVLOG(2) << __func__ << " drain_type:" << drain_type; | 957 DVLOG(2) << __func__ << " drain_type:" << drain_type; |
963 DCHECK(thread_checker_.CalledOnValidThread()); | 958 DCHECK(thread_checker_.CalledOnValidThread()); |
964 | 959 |
965 // We assume that DRAIN_FOR_FLUSH and DRAIN_FOR_RESET cannot come while | 960 auto previous_drain_type = drain_type_; |
966 // another drain request is present, but DRAIN_FOR_DESTROY can. | |
967 DCHECK_NE(drain_type, DRAIN_TYPE_NONE); | |
968 DCHECK(drain_type_ == DRAIN_TYPE_NONE || drain_type == DRAIN_FOR_DESTROY) | |
969 << "Unexpected StartCodecDrain() with drain type " << drain_type | |
970 << " while already draining with drain type " << drain_type_; | |
971 | |
972 const bool enqueue_eos = drain_type_ == DRAIN_TYPE_NONE; | |
973 drain_type_ = drain_type; | 961 drain_type_ = drain_type; |
974 | 962 |
975 if (enqueue_eos) | 963 // Only DRAIN_FOR_DESTROY is allowed while a drain is already in progress. |
| 964 DCHECK(!previous_drain_type || drain_type == DRAIN_FOR_DESTROY) |
| 965 << "StartCodecDrain(" << drain_type |
| 966 << ") while already draining with type " << previous_drain_type.value(); |
| 967 |
| 968 // Skip the drain if: |
| 969 // * There's no codec. |
| 970 // * The codec is not currently decoding and we have no more inputs to submit. |
| 971 // (Reset() and Destroy() should clear pending inputs before calling this). |
| 972 // * The drain is for reset or destroy (where we can drop pending decodes) and |
| 973 // the codec is not VP8. We still have to drain VP8 in this case because |
| 974 // MediaCodec can hang in release() or flush() if we don't drain it. |
| 975 // http://crbug.com/598963 |
| 976 if (!media_codec_ || (pending_bitstream_records_.empty() && |
| 977 bitstream_buffers_in_decoder_.empty()) || |
| 978 (drain_type != DRAIN_FOR_FLUSH && codec_config_->codec != kCodecVP8)) { |
| 979 OnDrainCompleted(); |
| 980 return; |
| 981 } |
| 982 |
| 983 // Queue EOS if one is not already queued. |
| 984 if (!previous_drain_type) |
976 DecodeBuffer(BitstreamBuffer(-1, base::SharedMemoryHandle(), 0)); | 985 DecodeBuffer(BitstreamBuffer(-1, base::SharedMemoryHandle(), 0)); |
977 } | 986 } |
978 | 987 |
979 bool AndroidVideoDecodeAccelerator::IsDrainingForResetOrDestroy() const { | 988 bool AndroidVideoDecodeAccelerator::IsDrainingForResetOrDestroy() const { |
980 return drain_type_ == DRAIN_FOR_RESET || drain_type_ == DRAIN_FOR_DESTROY; | 989 return drain_type_ == DRAIN_FOR_RESET || drain_type_ == DRAIN_FOR_DESTROY; |
981 } | 990 } |
982 | 991 |
983 void AndroidVideoDecodeAccelerator::OnDrainCompleted() { | 992 void AndroidVideoDecodeAccelerator::OnDrainCompleted() { |
984 DVLOG(2) << __func__; | 993 DVLOG(2) << __func__; |
985 DCHECK(thread_checker_.CalledOnValidThread()); | 994 DCHECK(thread_checker_.CalledOnValidThread()); |
986 | 995 |
987 // If we were waiting for an EOS, clear the state and reset the MediaCodec | 996 // Sometimes MediaCodec returns an EOS buffer even if we didn't queue one. |
988 // as normal. | 997 // Consider it an error. http://crbug.com/585959. |
989 // | 998 if (!drain_type_) { |
990 // Some Android platforms seem to send an EOS buffer even when we're not | 999 state_ = ERROR; |
991 // expecting it. In this case, destroy and reset the codec but don't notify | 1000 ResetCodecState(); |
992 // flush done since it violates the state machine. http://crbug.com/585959. | 1001 return; |
| 1002 } |
993 | 1003 |
994 switch (drain_type_) { | 1004 ResetCodecState(); |
995 case DRAIN_TYPE_NONE: | 1005 switch (*drain_type_) { |
996 // Unexpected EOS. | |
997 state_ = ERROR; | |
998 ResetCodecState(); | |
999 break; | |
1000 case DRAIN_FOR_FLUSH: | 1006 case DRAIN_FOR_FLUSH: |
1001 ResetCodecState(); | |
1002 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1007 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1003 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyFlushDone, | 1008 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyFlushDone, |
1004 weak_this_factory_.GetWeakPtr())); | 1009 weak_this_factory_.GetWeakPtr())); |
1005 break; | 1010 break; |
1006 case DRAIN_FOR_RESET: | 1011 case DRAIN_FOR_RESET: |
1007 ResetCodecState(); | |
1008 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1012 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1009 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone, | 1013 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone, |
1010 weak_this_factory_.GetWeakPtr())); | 1014 weak_this_factory_.GetWeakPtr())); |
1011 break; | 1015 break; |
1012 case DRAIN_FOR_DESTROY: | 1016 case DRAIN_FOR_DESTROY: |
1013 ResetCodecState(); | |
1014 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1017 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1015 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::ActualDestroy, | 1018 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::ActualDestroy, |
1016 weak_this_factory_.GetWeakPtr())); | 1019 weak_this_factory_.GetWeakPtr())); |
1017 break; | 1020 break; |
1018 } | 1021 } |
1019 drain_type_ = DRAIN_TYPE_NONE; | 1022 drain_type_.reset(); |
1020 } | 1023 } |
1021 | 1024 |
1022 void AndroidVideoDecodeAccelerator::ResetCodecState() { | 1025 void AndroidVideoDecodeAccelerator::ResetCodecState() { |
1023 DCHECK(thread_checker_.CalledOnValidThread()); | 1026 DCHECK(thread_checker_.CalledOnValidThread()); |
1024 | 1027 |
1025 // If there is already a reset in flight, then that counts. This can really | 1028 // If there is already a reset in flight, then that counts. This can really |
1026 // only happen if somebody calls Reset. | 1029 // only happen if somebody calls Reset. |
1027 // If the surface is destroyed there's nothing to do. | 1030 // If the surface is destroyed there's nothing to do. |
1028 if (state_ == WAITING_FOR_CODEC || state_ == SURFACE_DESTROYED) | 1031 if (state_ == WAITING_FOR_CODEC || state_ == SURFACE_DESTROYED || |
| 1032 !media_codec_) { |
1029 return; | 1033 return; |
| 1034 } |
1030 | 1035 |
1031 bitstream_buffers_in_decoder_.clear(); | 1036 bitstream_buffers_in_decoder_.clear(); |
1032 | 1037 |
1033 if (pending_input_buf_index_ != -1) { | 1038 if (pending_input_buf_index_ != -1) { |
1034 // The data for that index exists in the input buffer, but corresponding | 1039 // The data for that index exists in the input buffer, but corresponding |
1035 // shm block been deleted. Check that it is safe to flush the codec, i.e. | 1040 // shm block been deleted. Check that it is safe to flush the codec, i.e. |
1036 // |pending_bitstream_records_| is empty. | 1041 // |pending_bitstream_records_| is empty. |
1037 // TODO(timav): keep shm block for that buffer and remove this restriction. | 1042 // TODO(timav): keep shm block for that buffer and remove this restriction. |
1038 DCHECK(pending_bitstream_records_.empty()); | 1043 DCHECK(pending_bitstream_records_.empty()); |
1039 pending_input_buf_index_ = -1; | 1044 pending_input_buf_index_ = -1; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1095 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1091 FROM_HERE, | 1096 FROM_HERE, |
1092 base::Bind(&AndroidVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer, | 1097 base::Bind(&AndroidVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer, |
1093 weak_this_factory_.GetWeakPtr(), bitstream_buffer_id)); | 1098 weak_this_factory_.GetWeakPtr(), bitstream_buffer_id)); |
1094 } | 1099 } |
1095 } | 1100 } |
1096 TRACE_COUNTER1("media", "AVDA::PendingBitstreamBufferCount", 0); | 1101 TRACE_COUNTER1("media", "AVDA::PendingBitstreamBufferCount", 0); |
1097 bitstreams_notified_in_advance_.clear(); | 1102 bitstreams_notified_in_advance_.clear(); |
1098 | 1103 |
1099 picture_buffer_manager_.ReleaseCodecBuffers(output_picture_buffers_); | 1104 picture_buffer_manager_.ReleaseCodecBuffers(output_picture_buffers_); |
1100 | 1105 StartCodecDrain(DRAIN_FOR_RESET); |
1101 // Some VP8 files require complete MediaCodec drain before we can call | |
1102 // MediaCodec.flush() or MediaCodec.reset(). http://crbug.com/598963. | |
1103 if (media_codec_ && codec_config_->codec == kCodecVP8 && | |
1104 !bitstream_buffers_in_decoder_.empty()) { | |
1105 // Postpone ResetCodecState() after the drain. | |
1106 StartCodecDrain(DRAIN_FOR_RESET); | |
1107 } else { | |
1108 ResetCodecState(); | |
1109 base::ThreadTaskRunnerHandle::Get()->PostTask( | |
1110 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone, | |
1111 weak_this_factory_.GetWeakPtr())); | |
1112 } | |
1113 } | 1106 } |
1114 | 1107 |
1115 void AndroidVideoDecodeAccelerator::SetSurface(int32_t surface_id) { | 1108 void AndroidVideoDecodeAccelerator::SetSurface(int32_t surface_id) { |
1116 DVLOG(1) << __func__; | 1109 DVLOG(1) << __func__; |
1117 DCHECK(thread_checker_.CalledOnValidThread()); | 1110 DCHECK(thread_checker_.CalledOnValidThread()); |
1118 | 1111 |
1119 if (surface_id == config_.surface_id) { | 1112 if (surface_id == config_.surface_id) { |
1120 pending_surface_id_.reset(); | 1113 pending_surface_id_.reset(); |
1121 return; | 1114 return; |
1122 } | 1115 } |
1123 | 1116 |
1124 // Surface changes never take effect immediately, they will be handled during | 1117 // Surface changes never take effect immediately, they will be handled during |
1125 // DequeOutput() once we get to a good switch point or immediately during an | 1118 // DequeOutput() once we get to a good switch point or immediately during an |
1126 // OnSurfaceDestroyed() call. | 1119 // OnSurfaceDestroyed() call. |
1127 pending_surface_id_ = surface_id; | 1120 pending_surface_id_ = surface_id; |
1128 } | 1121 } |
1129 | 1122 |
1130 void AndroidVideoDecodeAccelerator::Destroy() { | 1123 void AndroidVideoDecodeAccelerator::Destroy() { |
1131 DVLOG(1) << __func__; | 1124 DVLOG(1) << __func__; |
1132 DCHECK(thread_checker_.CalledOnValidThread()); | 1125 DCHECK(thread_checker_.CalledOnValidThread()); |
1133 | 1126 |
1134 picture_buffer_manager_.Destroy(output_picture_buffers_); | 1127 picture_buffer_manager_.Destroy(output_picture_buffers_); |
1135 | |
1136 client_ = nullptr; | 1128 client_ = nullptr; |
1137 | 1129 |
1138 // Some VP8 files require a complete MediaCodec drain before we can call | 1130 // We don't want to queue more inputs while draining. |
1139 // MediaCodec.flush() or MediaCodec.release(). http://crbug.com/598963. In | 1131 std::queue<BitstreamRecord>().swap(pending_bitstream_records_); |
1140 // that case, postpone ActualDestroy() until after the drain. | 1132 StartCodecDrain(DRAIN_FOR_DESTROY); |
1141 if (media_codec_ && codec_config_->codec == kCodecVP8) { | |
1142 // Clear |pending_bitstream_records_|. | |
1143 while (!pending_bitstream_records_.empty()) | |
1144 pending_bitstream_records_.pop(); | |
1145 | |
1146 StartCodecDrain(DRAIN_FOR_DESTROY); | |
1147 } else { | |
1148 ActualDestroy(); | |
1149 } | |
1150 } | 1133 } |
1151 | 1134 |
1152 void AndroidVideoDecodeAccelerator::ActualDestroy() { | 1135 void AndroidVideoDecodeAccelerator::ActualDestroy() { |
1153 DVLOG(1) << __func__; | 1136 DVLOG(1) << __func__; |
1154 DCHECK(thread_checker_.CalledOnValidThread()); | 1137 DCHECK(thread_checker_.CalledOnValidThread()); |
1155 | 1138 |
1156 // Note that async codec construction might still be in progress. In that | 1139 // Note that async codec construction might still be in progress. In that |
1157 // case, the codec will be deleted when it completes once we invalidate all | 1140 // case, the codec will be deleted when it completes once we invalidate all |
1158 // our weak refs. | 1141 // our weak refs. |
1159 weak_this_factory_.InvalidateWeakPtrs(); | 1142 weak_this_factory_.InvalidateWeakPtrs(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 // SURFACE_DESTROYED. | 1198 // SURFACE_DESTROYED. |
1216 state_ = SURFACE_DESTROYED; | 1199 state_ = SURFACE_DESTROYED; |
1217 if (media_codec_) { | 1200 if (media_codec_) { |
1218 AVDACodecAllocator::Instance()->ReleaseMediaCodec( | 1201 AVDACodecAllocator::Instance()->ReleaseMediaCodec( |
1219 std::move(media_codec_), codec_config_->task_type, config_.surface_id); | 1202 std::move(media_codec_), codec_config_->task_type, config_.surface_id); |
1220 picture_buffer_manager_.CodecChanged(nullptr); | 1203 picture_buffer_manager_.CodecChanged(nullptr); |
1221 } | 1204 } |
1222 | 1205 |
1223 // If we're draining, signal completion now because the drain can no longer | 1206 // If we're draining, signal completion now because the drain can no longer |
1224 // proceed. | 1207 // proceed. |
1225 if (drain_type_ != DRAIN_TYPE_NONE) | 1208 if (drain_type_) |
1226 OnDrainCompleted(); | 1209 OnDrainCompleted(); |
1227 } | 1210 } |
1228 | 1211 |
1229 void AndroidVideoDecodeAccelerator::InitializeCdm() { | 1212 void AndroidVideoDecodeAccelerator::InitializeCdm() { |
1230 DVLOG(2) << __func__ << ": " << config_.cdm_id; | 1213 DVLOG(2) << __func__ << ": " << config_.cdm_id; |
1231 | 1214 |
1232 #if !defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 1215 #if !defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
1233 NOTIMPLEMENTED(); | 1216 NOTIMPLEMENTED(); |
1234 NotifyInitializationComplete(false); | 1217 NotifyInitializationComplete(false); |
1235 #else | 1218 #else |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 AVDACodecAllocator::Instance()->DeallocateSurface(this, new_surface_id); | 1493 AVDACodecAllocator::Instance()->DeallocateSurface(this, new_surface_id); |
1511 } | 1494 } |
1512 | 1495 |
1513 // Regardless of whether we succeeded, we no longer own the previous surface. | 1496 // Regardless of whether we succeeded, we no longer own the previous surface. |
1514 AVDACodecAllocator::Instance()->DeallocateSurface(this, previous_surface_id); | 1497 AVDACodecAllocator::Instance()->DeallocateSurface(this, previous_surface_id); |
1515 | 1498 |
1516 return success; | 1499 return success; |
1517 } | 1500 } |
1518 | 1501 |
1519 } // namespace media | 1502 } // namespace media |
OLD | NEW |