| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef _ANDROID_MEDIA_UTILS_H_ |
| 18 |
#define _ANDROID_MEDIA_UTILS_H_ |
| 19 |
|
| 20 |
#include <gui/CpuConsumer.h> |
| 21 |
|
| 22 |
namespace android { |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
typedef CpuConsumer::LockedBuffer LockedImage; |
| 27 |
|
| 28 |
bool usingRGBAToJpegOverride(int32_t imageFormat, int32_t containerFormat); |
| 29 |
|
| 30 |
int32_t applyFormatOverrides(int32_t imageFormat, int32_t containerFormat); |
| 31 |
|
| 32 |
uint32_t Image_getBlobSize(LockedImage* buffer, bool usingRGBAOverride); |
| 33 |
|
| 34 |
bool isFormatOpaque(int format); |
| 35 |
|
| 36 |
bool isPossiblyYUV(PixelFormat format); |
| 37 |
|
| 38 |
bool isPossibly10BitYUV(PixelFormat format); |
| 39 |
|
| 40 |
status_t getLockedImageInfo(LockedImage* buffer, int idx, int32_t containerFormat, |
| 41 |
uint8_t **base, uint32_t *size, int *pixelStride, int *rowStride); |
| 42 |
|
| 43 |
status_t lockImageFromBuffer(sp<GraphicBuffer> buffer, uint32_t inUsage, |
| 44 |
const Rect& rect, int fenceFd, LockedImage* outputImage); |
| 45 |
|
| 46 |
status_t lockImageFromBuffer(BufferItem* bufferItem, uint32_t inUsage, |
| 47 |
int fenceFd, LockedImage* outputImage); |
| 48 |
|
| 49 |
int getBufferWidth(BufferItem *buffer); |
| 50 |
|
| 51 |
int getBufferHeight(BufferItem *buffer); |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
typedef struct camera3_jpeg_blob_v2 { |
| 57 |
uint32_t jpeg_blob_id; |
| 58 |
uint32_t jpeg_size; |
| 59 |
} camera3_jpeg_blobv2_t; |
| 60 |
|
| 61 |
|
| 62 |
enum { |
| 63 |
CAMERA3_JPEG_BLOB_ID = 0x00FF, |
| 64 |
CAMERA3_JPEG_APP_SEGMENTS_BLOB_ID = 0x0100, |
| 65 |
}; |
| 66 |
|
| 67 |
}; |
| 68 |
|
| 69 |
#endif |