| Marco Nelissen | 0c3be87 | 2014-05-01 10:14:44 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2014 The Android Open Source Project | 
|  | 3 | * | 
|  | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | * you may not use this file except in compliance with the License. | 
|  | 6 | * You may obtain a copy of the License at | 
|  | 7 | * | 
|  | 8 | *      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | * | 
|  | 10 | * Unless required by applicable law or agreed to in writing, software | 
|  | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | * See the License for the specific language governing permissions and | 
|  | 14 | * limitations under the License. | 
|  | 15 | */ | 
|  | 16 |  | 
|  | 17 | /* | 
|  | 18 | * This file defines an NDK API. | 
|  | 19 | * Do not remove methods. | 
|  | 20 | * Do not change method signatures. | 
|  | 21 | * Do not change the value of constants. | 
|  | 22 | * Do not change the size of any of the classes defined in here. | 
|  | 23 | * Do not reference types that are not part of the NDK. | 
|  | 24 | * Do not #include files that aren't part of the NDK. | 
|  | 25 | */ | 
|  | 26 |  | 
|  | 27 | #ifndef _NDK_MEDIA_FORMAT_H | 
|  | 28 | #define _NDK_MEDIA_FORMAT_H | 
|  | 29 |  | 
|  | 30 | #include <sys/types.h> | 
|  | 31 |  | 
|  | 32 | #ifdef __cplusplus | 
|  | 33 | extern "C" { | 
|  | 34 | #endif | 
|  | 35 |  | 
|  | 36 | struct AMediaFormat; | 
|  | 37 | typedef struct AMediaFormat AMediaFormat; | 
|  | 38 |  | 
|  | 39 | AMediaFormat *AMediaFormat_new(); | 
|  | 40 | int AMediaFormat_delete(AMediaFormat*); | 
|  | 41 |  | 
|  | 42 | /** | 
| Marco Nelissen | 7c9b141 | 2014-05-06 10:33:07 -0700 | [diff] [blame^] | 43 | * Human readable representation of the format. The returned string is owned by the format, | 
|  | 44 | * and remains valid until the next call to toString, or until the format is deleted. | 
| Marco Nelissen | 0c3be87 | 2014-05-01 10:14:44 -0700 | [diff] [blame] | 45 | */ | 
|  | 46 | const char* AMediaFormat_toString(AMediaFormat*); | 
|  | 47 |  | 
|  | 48 | bool AMediaFormat_getInt32(AMediaFormat*, const char *name, int32_t *out); | 
|  | 49 | bool AMediaFormat_getInt64(AMediaFormat*, const char *name, int64_t *out); | 
|  | 50 | bool AMediaFormat_getFloat(AMediaFormat*, const char *name, float *out); | 
|  | 51 | bool AMediaFormat_getDouble(AMediaFormat*, const char *name, double *out); | 
|  | 52 | bool AMediaFormat_getSize(AMediaFormat*, const char *name, size_t *out); | 
|  | 53 | /** | 
| Marco Nelissen | 7c9b141 | 2014-05-06 10:33:07 -0700 | [diff] [blame^] | 54 | * The returned string is owned by the format, and remains valid until the next call to getString, | 
|  | 55 | * or until the format is deleted. | 
| Marco Nelissen | 0c3be87 | 2014-05-01 10:14:44 -0700 | [diff] [blame] | 56 | */ | 
|  | 57 | bool AMediaFormat_getString(AMediaFormat*, const char *name, const char **out); | 
|  | 58 |  | 
|  | 59 | /** | 
|  | 60 | * XXX should these be ints/enums that we look up in a table as needed? | 
|  | 61 | */ | 
|  | 62 | extern const char* AMEDIAFORMAT_KEY_AAC_PROFILE; | 
|  | 63 | extern const char* AMEDIAFORMAT_KEY_BIT_RATE; | 
|  | 64 | extern const char* AMEDIAFORMAT_KEY_CHANNEL_COUNT; | 
|  | 65 | extern const char* AMEDIAFORMAT_KEY_CHANNEL_MASK; | 
|  | 66 | extern const char* AMEDIAFORMAT_KEY_COLOR_FORMAT; | 
|  | 67 | extern const char* AMEDIAFORMAT_KEY_DURATION; | 
|  | 68 | extern const char* AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL; | 
|  | 69 | extern const char* AMEDIAFORMAT_KEY_FRAME_RATE; | 
|  | 70 | extern const char* AMEDIAFORMAT_KEY_HEIGHT; | 
|  | 71 | extern const char* AMEDIAFORMAT_KEY_IS_ADTS; | 
|  | 72 | extern const char* AMEDIAFORMAT_KEY_IS_AUTOSELECT; | 
|  | 73 | extern const char* AMEDIAFORMAT_KEY_IS_DEFAULT; | 
|  | 74 | extern const char* AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE; | 
|  | 75 | extern const char* AMEDIAFORMAT_KEY_I_FRAME_INTERVAL; | 
|  | 76 | extern const char* AMEDIAFORMAT_KEY_LANGUAGE; | 
|  | 77 | extern const char* AMEDIAFORMAT_KEY_MAX_HEIGHT; | 
|  | 78 | extern const char* AMEDIAFORMAT_KEY_MAX_INPUT_SIZE; | 
|  | 79 | extern const char* AMEDIAFORMAT_KEY_MAX_WIDTH; | 
|  | 80 | extern const char* AMEDIAFORMAT_KEY_MIME; | 
|  | 81 | extern const char* AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP; | 
|  | 82 | extern const char* AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER; | 
|  | 83 | extern const char* AMEDIAFORMAT_KEY_SAMPLE_RATE; | 
|  | 84 | extern const char* AMEDIAFORMAT_KEY_WIDTH; | 
|  | 85 | extern const char* AMEDIAFORMAT_KEY_STRIDE; | 
|  | 86 |  | 
|  | 87 | #ifdef __cplusplus | 
|  | 88 | } // extern "C" | 
|  | 89 | #endif | 
|  | 90 |  | 
|  | 91 | #endif // _NDK_MEDIA_FORMAT_H |