| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef _ANDROID_MEDIA_MEDIAEXTRACTOR_H_ |
| 18 |
#define _ANDROID_MEDIA_MEDIAEXTRACTOR_H_ |
| 19 |
|
| 20 |
#include <media/stagefright/foundation/ABase.h> |
| 21 |
#include <media/stagefright/foundation/AudioPresentationInfo.h> |
| 22 |
#include <media/stagefright/MediaSource.h> |
| 23 |
#include <media/DataSource.h> |
| 24 |
#include <utils/Errors.h> |
| 25 |
#include <utils/KeyedVector.h> |
| 26 |
#include <utils/RefBase.h> |
| 27 |
#include <utils/String8.h> |
| 28 |
|
| 29 |
#include "jni.h" |
| 30 |
|
| 31 |
namespace android { |
| 32 |
|
| 33 |
struct IMediaHTTPService; |
| 34 |
class MetaData; |
| 35 |
struct NuMediaExtractor; |
| 36 |
|
| 37 |
struct JMediaExtractor : public RefBase { |
| 38 |
JMediaExtractor(JNIEnv *env, jobject thiz); |
| 39 |
|
| 40 |
status_t setDataSource( |
| 41 |
const sp<IMediaHTTPService> &httpService, |
| 42 |
const char *path, |
| 43 |
const KeyedVector<String8, String8> *headers); |
| 44 |
|
| 45 |
status_t setDataSource(int fd, off64_t offset, off64_t size); |
| 46 |
status_t setDataSource(const sp<DataSource> &source); |
| 47 |
|
| 48 |
status_t setMediaCas(JNIEnv *env, jobject casBinderObj); |
| 49 |
|
| 50 |
size_t countTracks() const; |
| 51 |
status_t getTrackFormat(size_t index, jobject *format) const; |
| 52 |
|
| 53 |
status_t getFileFormat(jobject *format) const; |
| 54 |
|
| 55 |
status_t selectTrack(size_t index); |
| 56 |
status_t unselectTrack(size_t index); |
| 57 |
|
| 58 |
status_t seekTo(int64_t timeUs, MediaSource::ReadOptions::SeekMode mode); |
| 59 |
|
| 60 |
status_t advance(); |
| 61 |
status_t readSampleData(jobject byteBuf, size_t offset, size_t *sampleSize); |
| 62 |
status_t getSampleTrackIndex(size_t *trackIndex); |
| 63 |
status_t getSampleTime(int64_t *sampleTimeUs); |
| 64 |
status_t getSampleSize(size_t *sampleSize); |
| 65 |
status_t getSampleFlags(uint32_t *sampleFlags); |
| 66 |
status_t getSampleMeta(sp<MetaData> *sampleMeta); |
| 67 |
status_t getMetrics(Parcel *reply) const; |
| 68 |
|
| 69 |
bool getCachedDuration(int64_t *durationUs, bool *eos) const; |
| 70 |
status_t getAudioPresentations(size_t trackIdx, |
| 71 |
AudioPresentationCollection *presentations) const; |
| 72 |
|
| 73 |
status_t setLogSessionId(const String8& LogSessionId); |
| 74 |
|
| 75 |
protected: |
| 76 |
virtual ~JMediaExtractor(); |
| 77 |
|
| 78 |
private: |
| 79 |
jclass mClass; |
| 80 |
jweak mObject; |
| 81 |
sp<NuMediaExtractor> mImpl; |
| 82 |
|
| 83 |
DISALLOW_EVIL_CONSTRUCTORS(JMediaExtractor); |
| 84 |
}; |
| 85 |
|
| 86 |
} |
| 87 |
|
| 88 |
#endif |