OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/filters/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 DCHECK(!demuxer_stream_); | 122 DCHECK(!demuxer_stream_); |
123 if (!stream) { | 123 if (!stream) { |
124 status_cb.Run(PIPELINE_ERROR_DECODE); | 124 status_cb.Run(PIPELINE_ERROR_DECODE); |
125 return; | 125 return; |
126 } | 126 } |
127 | 127 |
128 // TODO(scherkus): this check should go in Pipeline prior to creating | 128 // TODO(scherkus): this check should go in Pipeline prior to creating |
129 // decoder objects. | 129 // decoder objects. |
130 const VideoDecoderConfig& config = stream->video_decoder_config(); | 130 const VideoDecoderConfig& config = stream->video_decoder_config(); |
131 if (!config.IsValidConfig()) { | 131 if (!config.IsValidConfig() || config.is_encrypted()) { |
132 DLOG(ERROR) << "Invalid video stream - " << config.AsHumanReadableString(); | 132 DLOG(ERROR) << "Unsupported video stream - " |
| 133 << config.AsHumanReadableString(); |
133 status_cb.Run(PIPELINE_ERROR_DECODE); | 134 status_cb.Run(PIPELINE_ERROR_DECODE); |
134 return; | 135 return; |
135 } | 136 } |
136 | 137 |
137 VideoDecodeAccelerator* vda = | 138 VideoDecodeAccelerator* vda = |
138 factories_->CreateVideoDecodeAccelerator(config.profile(), this); | 139 factories_->CreateVideoDecodeAccelerator(config.profile(), this); |
139 if (!vda) { | 140 if (!vda) { |
140 status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); | 141 status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); |
141 return; | 142 return; |
142 } | 143 } |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 | 546 |
546 error_occured_ = true; | 547 error_occured_ = true; |
547 | 548 |
548 if (!pending_read_cb_.is_null()) { | 549 if (!pending_read_cb_.is_null()) { |
549 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); | 550 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); |
550 return; | 551 return; |
551 } | 552 } |
552 } | 553 } |
553 | 554 |
554 } // namespace media | 555 } // namespace media |
OLD | NEW |