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

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

Issue 14932020: Add Create() function to AudioCodecBridge and VideoCodecBridge to allow return of null pointers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_
6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ 6 #define MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 base::android::ScopedJavaGlobalRef<jobjectArray> j_input_buffers_; 107 base::android::ScopedJavaGlobalRef<jobjectArray> j_input_buffers_;
108 108
109 // Output buffers used for *InputBuffer() methods. 109 // Output buffers used for *InputBuffer() methods.
110 base::android::ScopedJavaGlobalRef<jobjectArray> j_output_buffers_; 110 base::android::ScopedJavaGlobalRef<jobjectArray> j_output_buffers_;
111 111
112 DISALLOW_COPY_AND_ASSIGN(MediaCodecBridge); 112 DISALLOW_COPY_AND_ASSIGN(MediaCodecBridge);
113 }; 113 };
114 114
115 class AudioCodecBridge : public MediaCodecBridge { 115 class AudioCodecBridge : public MediaCodecBridge {
116 public: 116 public:
117 explicit AudioCodecBridge(const AudioCodec codec); 117 static AudioCodecBridge* Create(const AudioCodec codec);
118 118
119 // Start the audio codec bridge. 119 // Start the audio codec bridge.
120 bool Start(const AudioCodec codec, int sample_rate, int channel_count, 120 bool Start(const AudioCodec codec, int sample_rate, int channel_count,
121 const uint8* extra_data, size_t extra_data_size); 121 const uint8* extra_data, size_t extra_data_size);
122 private:
123 explicit AudioCodecBridge(const char* mime);
122 }; 124 };
123 125
124 class VideoCodecBridge : public MediaCodecBridge { 126 class VideoCodecBridge : public MediaCodecBridge {
125 public: 127 public:
126 explicit VideoCodecBridge(const VideoCodec codec); 128 static VideoCodecBridge* Create(const VideoCodec codec);
127 129
128 // Start the video codec bridge. 130 // Start the video codec bridge.
129 // TODO(qinmin): Pass codec specific data if available. 131 // TODO(qinmin): Pass codec specific data if available.
130 bool Start( 132 bool Start(
131 const VideoCodec codec, const gfx::Size& size, jobject surface); 133 const VideoCodec codec, const gfx::Size& size, jobject surface);
134
135 private:
136 explicit VideoCodecBridge(const char* mime);
132 }; 137 };
133 138
134 } // namespace media 139 } // namespace media
135 140
136 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_ 141 #endif // MEDIA_BASE_ANDROID_MEDIA_CODEC_BRIDGE_H_
137 142
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698