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

Side by Side Diff: media/base/android/media_codec_util.h

Issue 1472943002: Refactor MediaCodecBridge to add support for NDK APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crazy linker issue Created 5 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_
6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_
7
8 #include <jni.h>
9 #include <set>
10 #include <string>
11 #include <vector>
12
13 #include "base/compiler_specific.h"
14 #include "base/macros.h"
15 #include "media/base/media_export.h"
16
17 namespace media {
18
19 // Helper macro to skip the test if MediaCodecBridge isn't available.
20 #define SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE() \
21 do { \
22 if (!MediaCodecUtil::IsMediaCodecAvailable()) { \
23 VLOG(0) << "Could not run test - not supported on device."; \
24 return; \
25 } \
26 } while (0)
27
28 // Codec direction. Keep this in sync with MediaCodecUtil.java.
29 enum MediaCodecDirection {
30 MEDIA_CODEC_DECODER,
31 MEDIA_CODEC_ENCODER,
32 };
33
34 class MEDIA_EXPORT MediaCodecUtil {
35 public:
36 // Returns true if MediaCodec is available on the device.
37 // All other static methods check IsAvailable() internally. There's no need
38 // to check IsAvailable() explicitly before calling them.
39 static bool IsMediaCodecAvailable();
40
41 // Returns true if MediaCodec.setParameters() is available on the device.
42 static bool SupportsSetParameters();
43
44 // Returns whether MediaCodecBridge has a decoder that |is_secure| and can
45 // decode |codec| type.
46 static bool CanDecode(const std::string& codec, bool is_secure);
47
48 // Get a list of encoder supported color formats for |mime_type|.
49 // The mapping of color format name and its value refers to
50 // MediaCodecInfo.CodecCapabilities.
51 static std::set<int> GetEncoderColorFormats(const std::string& mime_type);
52
53 // Returns true if |mime_type| is known to be unaccelerated (i.e. backed by a
54 // software codec instead of a hardware one).
55 static bool IsKnownUnaccelerated(const std::string& mime_type,
56 MediaCodecDirection direction);
57
58 static bool RegisterMediaCodecUtil(JNIEnv* env);
59 };
60
61 } // namespace media
62
63 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_UTIL_H_
OLDNEW
« no previous file with comments | « media/base/android/media_codec_player_unittest.cc ('k') | media/base/android/media_codec_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698