| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef _ANDROID_MEDIA_STREAMS_H_ |
| 18 |
#define _ANDROID_MEDIA_STREAMS_H_ |
| 19 |
|
| 20 |
#include "src/piex_types.h" |
| 21 |
#include "src/piex.h" |
| 22 |
|
| 23 |
#include <jni.h> |
| 24 |
#include <nativehelper/JNIHelp.h> |
| 25 |
#include <utils/KeyedVector.h> |
| 26 |
#include <utils/String8.h> |
| 27 |
#include <utils/StrongPointer.h> |
| 28 |
|
| 29 |
namespace android { |
| 30 |
|
| 31 |
class FileStream : public piex::StreamInterface { |
| 32 |
private: |
| 33 |
FILE *mFile; |
| 34 |
size_t mPosition; |
| 35 |
|
| 36 |
public: |
| 37 |
explicit FileStream(const int fd); |
| 38 |
explicit FileStream(const String8 filename); |
| 39 |
~FileStream(); |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
piex::Error GetData( |
| 48 |
const size_t offset, const size_t length, std::uint8_t* data) override; |
| 49 |
bool exists() const; |
| 50 |
}; |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
bool GetExifFromRawImage( |
| 55 |
piex::StreamInterface* stream, const String8& filename, piex::PreviewImageData& image_data); |
| 56 |
|
| 57 |
|
| 58 |
bool ConvertKeyValueArraysToKeyedVector( |
| 59 |
JNIEnv *env, jobjectArray keys, jobjectArray values, |
| 60 |
KeyedVector<String8, String8>* vector); |
| 61 |
|
| 62 |
struct AMessage; |
| 63 |
status_t ConvertMessageToMap( |
| 64 |
JNIEnv *env, const sp<AMessage> &msg, jobject *map); |
| 65 |
|
| 66 |
status_t ConvertKeyValueArraysToMessage( |
| 67 |
JNIEnv *env, jobjectArray keys, jobjectArray values, |
| 68 |
sp<AMessage> *msg); |
| 69 |
|
| 70 |
}; |
| 71 |
|
| 72 |
#endif |