Home
last modified time | relevance | path

Searched refs:MediaCodec (Results 1 – 25 of 60) sorted by relevance

123

/frameworks/av/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/
DEncoder.java19 import android.media.MediaCodec;
20 import android.media.MediaCodec.CodecException;
40 private MediaCodec mCodec;
79 private MediaCodec createCodec(String codecName, String mime) throws IOException { in createCodec()
81 MediaCodec codec; in createCodec()
85 codec = MediaCodec.createEncoderByType(mime); in createCodec()
93 codec = MediaCodec.createByCodecName(codecName); in createCodec()
130 mCodec.configure(encodeFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); in encode()
131 } catch (IllegalArgumentException | IllegalStateException | MediaCodec.CryptoException e) { in encode()
151 mCodec.setCallback(new MediaCodec.Callback() { in encode()
[all …]
DDecoder.java19 import android.media.MediaCodec;
20 import android.media.MediaCodec.BufferInfo;
37 private MediaCodec mCodec;
63 private MediaCodec createCodec(String codecName, MediaFormat format) throws IOException { in createCodec()
66 MediaCodec codec; in createCodec()
70 codec = MediaCodec.createDecoderByType(mime); in createCodec()
78 codec = MediaCodec.createByCodecName(codecName); in createCodec()
118 mCodec.setCallback(new MediaCodec.Callback() { in decode()
121 @NonNull MediaCodec mediaCodec, int inputBufferId) { in decode()
132 public void onOutputBufferAvailable(@NonNull MediaCodec mediaCodec, in decode()
[all …]
DExtractor.java19 import android.media.MediaCodec;
33 private MediaCodec.BufferInfo mBufferInfo;
39 mBufferInfo = new MediaCodec.BufferInfo(); in Extractor()
76 public MediaCodec.BufferInfo getBufferInfo() { return this.mBufferInfo; } in getBufferInfo()
92 mBufferInfo.flags = MediaCodec.BUFFER_FLAG_END_OF_STREAM; in getFrameSample()
DMuxer.java19 import android.media.MediaCodec;
65 ArrayList<MediaCodec.BufferInfo> inputBufferInfo) { in mux()
/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/decoder/
DTrackDecoder.java20 import android.media.MediaCodec;
21 import android.media.MediaCodec.BufferInfo;
47 private MediaCodec mMediaCodec;
58 protected abstract MediaCodec initMediaCodec(MediaFormat format); in initMediaCodec()
67 MediaCodec codec, ByteBuffer[] buffers, int bufferIndex, BufferInfo info); in onDataAvailable()
102 protected MediaCodec getMediaCodec() { in getMediaCodec()
123 inputBufferIndex, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM); in feedInput()
148 inputBufferIndex, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM); in tryEnqueueEndOfStream()
157 if ((outputInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) { in drainOutputBuffer()
167 } else if (outputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) { in drainOutputBuffer()
[all …]
DAudioTrackDecoder.java20 import android.media.MediaCodec;
21 import android.media.MediaCodec.BufferInfo;
61 protected MediaCodec initMediaCodec(MediaFormat format) { in initMediaCodec()
62 MediaCodec mediaCodec; in initMediaCodec()
64 mediaCodec = MediaCodec.createDecoderByType( in initMediaCodec()
77 MediaCodec codec, ByteBuffer[] buffers, int bufferIndex, BufferInfo info) { in onDataAvailable()
DGpuVideoTrackDecoder.java22 import android.media.MediaCodec;
23 import android.media.MediaCodec.BufferInfo;
89 protected MediaCodec initMediaCodec(MediaFormat format) { in initMediaCodec()
90 MediaCodec mediaCodec; in initMediaCodec()
92 mediaCodec = MediaCodec.createDecoderByType( in initMediaCodec()
107 MediaCodec codec, ByteBuffer[] buffers, int bufferIndex, BufferInfo info) { in onDataAvailable()
DCpuVideoTrackDecoder.java20 import android.media.MediaCodec;
21 import android.media.MediaCodec.BufferInfo;
66 protected MediaCodec initMediaCodec(MediaFormat format) { in initMediaCodec()
68 MediaCodec mediaCodec = findDecoderCodec(format, new int[] { in initMediaCodec()
81 MediaCodec codec, ByteBuffer[] buffers, int bufferIndex, BufferInfo info) { in onDataAvailable()
184 private static MediaCodec findDecoderCodec(MediaFormat format, int[] requiredColorFormats) { in findDecoderCodec()
219 return MediaCodec.createByCodecName(bestCodec); in findDecoderCodec()
/frameworks/av/media/libstagefright/
DMediaCodec.cpp124 explicit ResourceManagerClient(MediaCodec* codec) : mMediaCodec(codec) {} in ResourceManagerClient()
127 sp<MediaCodec> codec = mMediaCodec.promote(); in reclaimResource()
147 sp<MediaCodec> codec = mMediaCodec.promote(); in getName()
164 wp<MediaCodec> mMediaCodec;
169 MediaCodec::ResourceManagerServiceProxy::ResourceManagerServiceProxy( in ResourceManagerServiceProxy()
172 if (mPid == MediaCodec::kNoPid) { in ResourceManagerServiceProxy()
177 MediaCodec::ResourceManagerServiceProxy::~ResourceManagerServiceProxy() { in ~ResourceManagerServiceProxy()
183 void MediaCodec::ResourceManagerServiceProxy::init() { in init()
194 void MediaCodec::ResourceManagerServiceProxy::binderDied(const wp<IBinder>& /*who*/) { in binderDied()
200 void MediaCodec::ResourceManagerServiceProxy::addResource( in addResource()
[all …]
DSimpleDecodingSource.cpp70 sp<MediaCodec> codec; in Create()
71 auto configure = [=](const sp<MediaCodec> &codec, const AString &componentName) in Create()
95 codec = MediaCodec::CreateByComponentName(looper, desiredCodec); in Create()
107 codec = MediaCodec::CreateByComponentName(looper, componentName); in Create()
122 const sp<MediaCodec> &codec, const sp<MediaSource> &source, const sp<ALooper> &looper, in SimpleDecodingSource()
287 0 /* pts */, MediaCodec::BUFFER_FLAG_EOS) != OK) { in doRead()
381 if (out_flags & MediaCodec::BUFFER_FLAG_EOS) { in doRead()
DMediaCodecSource.cpp504 mEncoder = MediaCodec::CreateByComponentName(mCodecLooper, name); in initEncoder()
513 MediaCodec::CONFIGURE_FLAG_ENCODE); in initEncoder()
522 mEncoder = MediaCodec::CreateByComponentName( in initEncoder()
538 MediaCodec::CONFIGURE_FLAG_ENCODE); in initEncoder()
754 flags = MediaCodec::BUFFER_FLAG_EOS; in feedEncoderInputBuffers()
874 if (cbID == MediaCodec::CB_INPUT_AVAILABLE) { in onMessageReceived()
880 } else if (cbID == MediaCodec::CB_OUTPUT_FORMAT_CHANGED) { in onMessageReceived()
889 } else if (cbID == MediaCodec::CB_OUTPUT_AVAILABLE) { in onMessageReceived()
902 if (flags & MediaCodec::BUFFER_FLAG_EOS) { in onMessageReceived()
920 if (!(flags & MediaCodec::BUFFER_FLAG_CODECCONFIG)) { in onMessageReceived()
[all …]
/frameworks/base/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/
DDisplaySourceService.java26 import android.media.MediaCodec;
27 import android.media.MediaCodec.BufferInfo;
195 MediaCodec codec; in run()
197 codec = MediaCodec.createEncoderByType("video/avc"); in run()
202 codec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); in run()
227 private void stream(MediaCodec codec) { in stream()
244 } else if (index == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) { in stream()
246 } else if (index == MediaCodec.INFO_TRY_AGAIN_LATER) { in stream()
/frameworks/base/media/java/android/media/
DAmrInputStream.java20 import android.media.MediaCodec.BufferInfo;
38 MediaCodec mCodec;
72 mCodec = MediaCodec.createByCodecName(name); in AmrInputStream()
76 MediaCodec.CONFIGURE_FLAG_ENCODE); in AmrInputStream()
141 mSawInputEOS ? MediaCodec.BUFFER_FLAG_END_OF_STREAM : 0 /* flags */); in read()
152 if ((mInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) { in read()
DMediaCodec.java1532 final public class MediaCodec { class
1685 private MediaCodec mCodec;
1687 public EventHandler(@NonNull MediaCodec codec, @NonNull Looper looper) { in EventHandler()
1702 mCallback = (MediaCodec.Callback) msg.obj; in handleMessage()
1748 BufferInfo info = (MediaCodec.BufferInfo) msg.obj; in handleCallback()
1759 mCallback.onError(mCodec, (MediaCodec.CodecException) msg.obj); in handleCallback()
1810 public static MediaCodec createDecoderByType(@NonNull String type) in createDecoderByType()
1812 return new MediaCodec(type, true /* nameIsType */, false /* encoder */); in createDecoderByType()
1828 public static MediaCodec createEncoderByType(@NonNull String type) in createEncoderByType()
1830 return new MediaCodec(type, true /* nameIsType */, true /* encoder */); in createEncoderByType()
[all …]
/frameworks/base/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/
DDisplaySinkService.java25 import android.media.MediaCodec;
26 import android.media.MediaCodec.BufferInfo;
51 private MediaCodec mCodec;
155 mCodec = MediaCodec.createDecoderByType("video/avc"); in updateSurfaceFromUi()
223 } else if (index != MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED in consumeCodecOutputLocked()
224 && index != MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { in consumeCodecOutputLocked()
/frameworks/av/media/libstagefright/include/media/stagefright/
DSimpleDecodingSource.h34 struct MediaCodec;
76 const sp<MediaCodec> &codec, const sp<MediaSource> &source, const sp<ALooper> &looper,
79 sp<MediaCodec> mCodec;
DMediaCodec.h59 struct MediaCodec : public AHandler { struct
83 static sp<MediaCodec> CreateByType( argument
87 static sp<MediaCodec> CreateByComponentName(
203 virtual ~MediaCodec();
386 MediaCodec(const sp<ALooper> &looper, pid_t pid, uid_t uid); argument
517 DISALLOW_EVIL_CONSTRUCTORS(MediaCodec); argument
/frameworks/av/cmds/stagefright/
Dmediafilter.cpp133 sp<MediaCodec> mCodec;
306 if (flags & MediaCodec::BUFFER_FLAG_EOS) { in tryDrainOutputBuffer()
355 state->mCodec = MediaCodec::CreateByType( in decode()
398 filterState->mCodec = MediaCodec::CreateByComponentName( in decode()
405 filterState->mCodec = MediaCodec::CreateByComponentName( in decode()
412 filterState->mCodec = MediaCodec::CreateByComponentName( in decode()
425 filterState->mCodec = MediaCodec::CreateByComponentName( in decode()
437 filterState->mCodec = MediaCodec::CreateByComponentName( in decode()
449 filterState->mCodec = MediaCodec::CreateByComponentName( in decode()
474 sp<MediaCodec> codec = state->mCodec; in decode()
[all …]
DSimplePlayer.h27 struct MediaCodec;
75 sp<MediaCodec> mCodec;
Dcodec.cpp58 sp<MediaCodec> mCodec;
123 state->mCodec = MediaCodec::CreateByType( in decode()
147 sp<MediaCodec> codec = state->mCodec; in decode()
221 MediaCodec::BUFFER_FLAG_EOS); in decode()
288 if (flags & MediaCodec::BUFFER_FLAG_EOS) { in decode()
/frameworks/av/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/
DMuxerTest.java27 import android.media.MediaCodec;
120 ArrayList<MediaCodec.BufferInfo> inputBufferInfo = new ArrayList<>(); in testMuxer()
127 MediaCodec.BufferInfo bufferInfo = extractor.getBufferInfo(); in testMuxer()
128 MediaCodec.BufferInfo tempBufferInfo = new MediaCodec.BufferInfo(); in testMuxer()
DDecoderTest.java20 import android.media.MediaCodec;
131 ArrayList<MediaCodec.BufferInfo> frameInfo = new ArrayList<>(); in testDecoder()
144 MediaCodec.BufferInfo bufInfo = new MediaCodec.BufferInfo(); in testDecoder()
145 MediaCodec.BufferInfo info = extractor.getBufferInfo(); in testDecoder()
DEncoderTest.java20 import android.media.MediaCodec;
180 ArrayList<MediaCodec.BufferInfo> frameInfo = new ArrayList<>(); in decodeFile()
188 MediaCodec.BufferInfo bufInfo = new MediaCodec.BufferInfo(); in decodeFile()
189 MediaCodec.BufferInfo info = extractor.getBufferInfo(); in decodeFile()
/frameworks/av/cmds/screenrecord/
Dscreenrecord.cpp71 using android::MediaCodec;
176 static status_t prepareEncoder(float displayFps, sp<MediaCodec>* pCodec, in prepareEncoder()
204 sp<MediaCodec> codec; in prepareEncoder()
206 codec = MediaCodec::CreateByType(looper, kMimeTypeAvc, true); in prepareEncoder()
213 codec = MediaCodec::CreateByComponentName(looper, gCodecName); in prepareEncoder()
222 MediaCodec::CONFIGURE_FLAG_ENCODE); in prepareEncoder()
233 sp<PersistentSurface> surface = MediaCodec::CreatePersistentInputSurface(); in prepareEncoder()
361 static status_t runEncoder(const sp<MediaCodec>& encoder, in runEncoder()
408 if ((flags & MediaCodec::BUFFER_FLAG_CODECCONFIG) != 0) { in runEncoder()
452 if ((flags & MediaCodec::BUFFER_FLAG_CODECCONFIG) == 0) { in runEncoder()
[all …]
/frameworks/av/media/codec2/sfplugin/tests/
DMediaCodec_sanity_test.cpp54 sp<MediaCodec> codec;
111 codec = MediaCodec::CreateByComponentName(looper, "c2.android.avc.decoder"); in TEST_P()
140 codec = MediaCodec::CreateByComponentName(looper, "c2.android.vp8.decoder"); in TEST_P()
169 codec = MediaCodec::CreateByComponentName(looper, "c2.android.aac.decoder"); in TEST_P()
204 codec = MediaCodec::CreateByComponentName(looper, "c2.android.avc.decoder"); in TEST_F()
263 codec = MediaCodec::CreateByComponentName(looper, "c2.android.mpeg4.decoder"); in TEST_F()
288 codec = MediaCodec::CreateByComponentName(looper, "c2.android.avc.decoder"); in TEST_P()

123