109daada236c0b4970db44c807d7c29965666c36bAndreas Huber/* 209daada236c0b4970db44c807d7c29965666c36bAndreas Huber * Copyright (C) 2009 The Android Open Source Project 309daada236c0b4970db44c807d7c29965666c36bAndreas Huber * 409daada236c0b4970db44c807d7c29965666c36bAndreas Huber * Licensed under the Apache License, Version 2.0 (the "License"); 509daada236c0b4970db44c807d7c29965666c36bAndreas Huber * you may not use this file except in compliance with the License. 609daada236c0b4970db44c807d7c29965666c36bAndreas Huber * You may obtain a copy of the License at 709daada236c0b4970db44c807d7c29965666c36bAndreas Huber * 809daada236c0b4970db44c807d7c29965666c36bAndreas Huber * http://www.apache.org/licenses/LICENSE-2.0 909daada236c0b4970db44c807d7c29965666c36bAndreas Huber * 1009daada236c0b4970db44c807d7c29965666c36bAndreas Huber * Unless required by applicable law or agreed to in writing, software 1109daada236c0b4970db44c807d7c29965666c36bAndreas Huber * distributed under the License is distributed on an "AS IS" BASIS, 1209daada236c0b4970db44c807d7c29965666c36bAndreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1309daada236c0b4970db44c807d7c29965666c36bAndreas Huber * See the License for the specific language governing permissions and 1409daada236c0b4970db44c807d7c29965666c36bAndreas Huber * limitations under the License. 1509daada236c0b4970db44c807d7c29965666c36bAndreas Huber */ 1609daada236c0b4970db44c807d7c29965666c36bAndreas Huber 1709daada236c0b4970db44c807d7c29965666c36bAndreas Huber#ifndef JPEG_SOURCE_H_ 1809daada236c0b4970db44c807d7c29965666c36bAndreas Huber 1909daada236c0b4970db44c807d7c29965666c36bAndreas Huber#define JPEG_SOURCE_H_ 2009daada236c0b4970db44c807d7c29965666c36bAndreas Huber 2109daada236c0b4970db44c807d7c29965666c36bAndreas Huber#include <media/stagefright/MediaSource.h> 2209daada236c0b4970db44c807d7c29965666c36bAndreas Huber 2309daada236c0b4970db44c807d7c29965666c36bAndreas Hubernamespace android { 2409daada236c0b4970db44c807d7c29965666c36bAndreas Huber 2509daada236c0b4970db44c807d7c29965666c36bAndreas Huberclass DataSource; 2609daada236c0b4970db44c807d7c29965666c36bAndreas Huberclass MediaBufferGroup; 2709daada236c0b4970db44c807d7c29965666c36bAndreas Huber 2809daada236c0b4970db44c807d7c29965666c36bAndreas Huberstruct JPEGSource : public MediaSource { 2909daada236c0b4970db44c807d7c29965666c36bAndreas Huber JPEGSource(const sp<DataSource> &source); 3009daada236c0b4970db44c807d7c29965666c36bAndreas Huber 3109daada236c0b4970db44c807d7c29965666c36bAndreas Huber virtual status_t start(MetaData *params = NULL); 3209daada236c0b4970db44c807d7c29965666c36bAndreas Huber virtual status_t stop(); 3309daada236c0b4970db44c807d7c29965666c36bAndreas Huber virtual sp<MetaData> getFormat(); 3409daada236c0b4970db44c807d7c29965666c36bAndreas Huber 3509daada236c0b4970db44c807d7c29965666c36bAndreas Huber virtual status_t read( 3609daada236c0b4970db44c807d7c29965666c36bAndreas Huber MediaBuffer **buffer, const ReadOptions *options = NULL); 3709daada236c0b4970db44c807d7c29965666c36bAndreas Huber 3809daada236c0b4970db44c807d7c29965666c36bAndreas Huberprotected: 3909daada236c0b4970db44c807d7c29965666c36bAndreas Huber virtual ~JPEGSource(); 4009daada236c0b4970db44c807d7c29965666c36bAndreas Huber 4109daada236c0b4970db44c807d7c29965666c36bAndreas Huberprivate: 4209daada236c0b4970db44c807d7c29965666c36bAndreas Huber sp<DataSource> mSource; 4309daada236c0b4970db44c807d7c29965666c36bAndreas Huber MediaBufferGroup *mGroup; 4409daada236c0b4970db44c807d7c29965666c36bAndreas Huber bool mStarted; 45b1262a8b1dd23abad64465f9ffd25c44facdf4d2James Dong off64_t mSize; 4609daada236c0b4970db44c807d7c29965666c36bAndreas Huber int32_t mWidth, mHeight; 47b1262a8b1dd23abad64465f9ffd25c44facdf4d2James Dong off64_t mOffset; 4809daada236c0b4970db44c807d7c29965666c36bAndreas Huber 4909daada236c0b4970db44c807d7c29965666c36bAndreas Huber status_t parseJPEG(); 5009daada236c0b4970db44c807d7c29965666c36bAndreas Huber 5109daada236c0b4970db44c807d7c29965666c36bAndreas Huber JPEGSource(const JPEGSource &); 5209daada236c0b4970db44c807d7c29965666c36bAndreas Huber JPEGSource &operator=(const JPEGSource &); 5309daada236c0b4970db44c807d7c29965666c36bAndreas Huber}; 5409daada236c0b4970db44c807d7c29965666c36bAndreas Huber 5509daada236c0b4970db44c807d7c29965666c36bAndreas Huber} // namespace android 5609daada236c0b4970db44c807d7c29965666c36bAndreas Huber 5709daada236c0b4970db44c807d7c29965666c36bAndreas Huber#endif // JPEG_SOURCE_H_ 5809daada236c0b4970db44c807d7c29965666c36bAndreas Huber 59