Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Unified Diff: services/media/framework_create/decoder.cc

Issue 1686363002: Motown: ffmpeg implementations of framework 'parts' (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Retype some const unique_ptr<T>& parameters to const T&. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/media/framework_create/decoder.cc
diff --git a/services/media/framework_create/decoder.cc b/services/media/framework_create/decoder.cc
index c88dc58085b66549c20c136b9e88c93cc5407587..9a52410090d8081f1246de117614776efca4f79e 100644
--- a/services/media/framework_create/decoder.cc
+++ b/services/media/framework_create/decoder.cc
@@ -3,14 +3,24 @@
// found in the LICENSE file.
#include "services/media/framework/parts/decoder.h"
+#include "services/media/framework_ffmpeg/ffmpeg_decoder.h"
namespace mojo {
namespace media {
Result Decoder::Create(
- const std::unique_ptr<StreamType>& stream_type,
+ const StreamType& stream_type,
std::shared_ptr<Decoder>* decoder_out) {
- return Result::kUnsupportedOperation;
+ std::shared_ptr<Decoder> decoder;
+ Result result = FfmpegDecoder::Create(stream_type, &decoder);
+ if (result == Result::kOk) {
+ result = decoder->Init(stream_type);
+ if (result == Result::kOk) {
+ *decoder_out = decoder;
+ }
+ }
+
+ return result;
}
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698