/src/mozilla-central/dom/media/platforms/omx/OmxDecoderModule.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "OmxDecoderModule.h" |
8 | | |
9 | | #include "OmxDataDecoder.h" |
10 | | #include "OmxPlatformLayer.h" |
11 | | |
12 | | #ifdef MOZ_OMX |
13 | | #include "PureOmxPlatformLayer.h" |
14 | | #endif |
15 | | |
16 | | namespace mozilla { |
17 | | |
18 | | /* static */ bool |
19 | | OmxDecoderModule::Init() |
20 | 0 | { |
21 | | #ifdef MOZ_OMX |
22 | | return PureOmxPlatformLayer::Init(); |
23 | | #endif |
24 | | return false; |
25 | 0 | } |
26 | | |
27 | | OmxDecoderModule* |
28 | | OmxDecoderModule::Create() |
29 | 0 | { |
30 | | #ifdef MOZ_OMX |
31 | | if (Init()) { |
32 | | return new OmxDecoderModule(); |
33 | | } |
34 | | #endif |
35 | | return nullptr; |
36 | 0 | } |
37 | | |
38 | | already_AddRefed<MediaDataDecoder> |
39 | | OmxDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams) |
40 | 0 | { |
41 | 0 | RefPtr<OmxDataDecoder> decoder = new OmxDataDecoder(aParams.mConfig, |
42 | 0 | aParams.mTaskQueue, |
43 | 0 | aParams.mImageContainer); |
44 | 0 | return decoder.forget(); |
45 | 0 | } |
46 | | |
47 | | already_AddRefed<MediaDataDecoder> |
48 | | OmxDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams) |
49 | 0 | { |
50 | 0 | RefPtr<OmxDataDecoder> decoder = new OmxDataDecoder(aParams.mConfig, |
51 | 0 | aParams.mTaskQueue, |
52 | 0 | nullptr); |
53 | 0 | return decoder.forget(); |
54 | 0 | } |
55 | | |
56 | | bool |
57 | | OmxDecoderModule::SupportsMimeType(const nsACString& aMimeType, |
58 | | DecoderDoctorDiagnostics* aDiagnostics) const |
59 | 0 | { |
60 | 0 | return OmxPlatformLayer::SupportsMimeType(aMimeType); |
61 | 0 | } |
62 | | |
63 | | } |