Merge "media: MediaCodec buffer API revision"
This commit is contained in:
@@ -24983,7 +24983,9 @@ package android.media {
|
||||
method @Deprecated @NonNull public java.nio.ByteBuffer[] getOutputBuffers();
|
||||
method @NonNull public android.media.MediaFormat getOutputFormat();
|
||||
method @NonNull public android.media.MediaFormat getOutputFormat(int);
|
||||
method @NonNull public android.media.MediaCodec.OutputFrame getOutputFrame(int);
|
||||
method @Nullable public android.media.Image getOutputImage(int);
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest getQueueRequest(int);
|
||||
method public void queueInputBuffer(int, int, int, long, int) throws android.media.MediaCodec.CryptoException;
|
||||
method public void queueSecureInputBuffer(int, int, @NonNull android.media.MediaCodec.CryptoInfo, long, int) throws android.media.MediaCodec.CryptoException;
|
||||
method public void release();
|
||||
@@ -25007,6 +25009,7 @@ package android.media {
|
||||
field public static final int BUFFER_FLAG_PARTIAL_FRAME = 8; // 0x8
|
||||
field @Deprecated public static final int BUFFER_FLAG_SYNC_FRAME = 1; // 0x1
|
||||
field public static final int CONFIGURE_FLAG_ENCODE = 1; // 0x1
|
||||
field public static final int CONFIGURE_FLAG_USE_BLOCK_MODEL = 2; // 0x2
|
||||
field public static final int CRYPTO_MODE_AES_CBC = 2; // 0x2
|
||||
field public static final int CRYPTO_MODE_AES_CTR = 1; // 0x1
|
||||
field public static final int CRYPTO_MODE_UNENCRYPTED = 0; // 0x0
|
||||
@@ -25083,6 +25086,24 @@ package android.media {
|
||||
method public void set(int, int);
|
||||
}
|
||||
|
||||
public static final class MediaCodec.GraphicBlock {
|
||||
method protected void finalize();
|
||||
method public static boolean isCodecCopyFreeCompatible(@NonNull String[]);
|
||||
method public boolean isMappable();
|
||||
method @NonNull public android.media.Image map();
|
||||
method @NonNull public static android.media.MediaCodec.GraphicBlock obtain(int, int, int, long, @NonNull String[]);
|
||||
method public void recycle();
|
||||
}
|
||||
|
||||
public static final class MediaCodec.LinearBlock {
|
||||
method protected void finalize();
|
||||
method public static boolean isCodecCopyFreeCompatible(@NonNull String[]);
|
||||
method public boolean isMappable();
|
||||
method @NonNull public java.nio.ByteBuffer map();
|
||||
method @Nullable public static android.media.MediaCodec.LinearBlock obtain(int, @NonNull String[]);
|
||||
method public void recycle();
|
||||
}
|
||||
|
||||
public static final class MediaCodec.MetricsConstants {
|
||||
field public static final String CODEC = "android.media.mediacodec.codec";
|
||||
field public static final String ENCODER = "android.media.mediacodec.encoder";
|
||||
@@ -25100,6 +25121,27 @@ package android.media {
|
||||
method public void onFrameRendered(@NonNull android.media.MediaCodec, long, long);
|
||||
}
|
||||
|
||||
public static final class MediaCodec.OutputFrame {
|
||||
method public void getChangedKeys(@NonNull java.util.Set<java.lang.String>);
|
||||
method public int getFlags();
|
||||
method @NonNull public android.media.MediaFormat getFormat();
|
||||
method @Nullable public android.media.MediaCodec.GraphicBlock getGraphicBlock();
|
||||
method @Nullable public android.media.MediaCodec.LinearBlock getLinearBlock();
|
||||
method public long getPresentationTimeUs();
|
||||
}
|
||||
|
||||
public final class MediaCodec.QueueRequest {
|
||||
method public void queue();
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest setByteBufferParameter(@NonNull String, @NonNull java.nio.ByteBuffer);
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest setEncryptedLinearBlock(@NonNull android.media.MediaCodec.LinearBlock, int, @NonNull android.media.MediaCodec.CryptoInfo, long, int);
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest setFloatParameter(@NonNull String, float);
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest setGraphicBlock(@NonNull android.media.MediaCodec.GraphicBlock, long, int);
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest setIntegerParameter(@NonNull String, int);
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest setLinearBlock(@NonNull android.media.MediaCodec.LinearBlock, int, int, long, int);
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest setLongParameter(@NonNull String, long);
|
||||
method @NonNull public android.media.MediaCodec.QueueRequest setStringParameter(@NonNull String, @NonNull String);
|
||||
}
|
||||
|
||||
public final class MediaCodecInfo {
|
||||
method @NonNull public String getCanonicalName();
|
||||
method public android.media.MediaCodecInfo.CodecCapabilities getCapabilitiesForType(String);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,8 @@
|
||||
cc_library_shared {
|
||||
name: "libmedia_jni",
|
||||
|
||||
defaults: ["libcodec2-internal-defaults"],
|
||||
|
||||
srcs: [
|
||||
"android_media_ImageWriter.cpp",
|
||||
"android_media_ImageReader.cpp",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,8 @@
|
||||
#include <media/stagefright/foundation/AHandler.h>
|
||||
#include <utils/Errors.h>
|
||||
|
||||
class C2Buffer;
|
||||
|
||||
namespace android {
|
||||
|
||||
struct ABuffer;
|
||||
@@ -39,6 +41,7 @@ struct MediaCodec;
|
||||
struct PersistentSurface;
|
||||
class Surface;
|
||||
namespace hardware {
|
||||
class HidlMemory;
|
||||
namespace cas {
|
||||
namespace native {
|
||||
namespace V1_0 {
|
||||
@@ -97,6 +100,26 @@ struct JMediaCodec : public AHandler {
|
||||
uint32_t flags,
|
||||
AString *errorDetailMsg);
|
||||
|
||||
status_t queueBuffer(
|
||||
size_t index, const std::shared_ptr<C2Buffer> &buffer,
|
||||
int64_t timeUs, uint32_t flags, const sp<AMessage> &tunings,
|
||||
AString *errorDetailMsg);
|
||||
|
||||
status_t queueEncryptedLinearBlock(
|
||||
size_t index,
|
||||
const sp<hardware::HidlMemory> &buffer,
|
||||
size_t offset,
|
||||
const CryptoPlugin::SubSample *subSamples,
|
||||
size_t numSubSamples,
|
||||
const uint8_t key[16],
|
||||
const uint8_t iv[16],
|
||||
CryptoPlugin::Mode mode,
|
||||
const CryptoPlugin::Pattern &pattern,
|
||||
int64_t presentationTimeUs,
|
||||
uint32_t flags,
|
||||
const sp<AMessage> &tunings,
|
||||
AString *errorDetailMsg);
|
||||
|
||||
status_t dequeueInputBuffer(size_t *index, int64_t timeoutUs);
|
||||
|
||||
status_t dequeueOutputBuffer(
|
||||
@@ -120,6 +143,9 @@ struct JMediaCodec : public AHandler {
|
||||
status_t getImage(
|
||||
JNIEnv *env, bool input, size_t index, jobject *image) const;
|
||||
|
||||
status_t getOutputFrame(
|
||||
JNIEnv *env, jobject frame, size_t index) const;
|
||||
|
||||
status_t getName(JNIEnv *env, jstring *name) const;
|
||||
|
||||
status_t getCodecInfo(JNIEnv *env, jobject *codecInfo) const;
|
||||
@@ -147,17 +173,10 @@ private:
|
||||
jweak mObject;
|
||||
sp<Surface> mSurfaceTextureClient;
|
||||
|
||||
// java objects cached
|
||||
jclass mByteBufferClass;
|
||||
jobject mNativeByteOrderObj;
|
||||
jmethodID mByteBufferOrderMethodID;
|
||||
jmethodID mByteBufferPositionMethodID;
|
||||
jmethodID mByteBufferLimitMethodID;
|
||||
jmethodID mByteBufferAsReadOnlyBufferMethodID;
|
||||
|
||||
sp<ALooper> mLooper;
|
||||
sp<MediaCodec> mCodec;
|
||||
AString mNameAtCreation;
|
||||
bool mGraphicOutput{false};
|
||||
std::once_flag mReleaseFlag;
|
||||
|
||||
sp<AMessage> mCallbackNotification;
|
||||
@@ -170,8 +189,6 @@ private:
|
||||
JNIEnv *env, bool readOnly, bool clearBuffer, const sp<T> &buffer,
|
||||
jobject *buf) const;
|
||||
|
||||
void cacheJavaObjects(JNIEnv *env);
|
||||
void deleteJavaObjects(JNIEnv *env);
|
||||
void handleCallback(const sp<AMessage> &msg);
|
||||
void handleFrameRenderedNotification(const sp<AMessage> &msg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user