From bd7b43bb02852e51b3000185fa66e10c56b120e0 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Tue, 13 Oct 2009 10:22:55 -0700 Subject: Separated private from public header files. --- include/media/stagefright/ESDS.h | 64 ------------- include/media/stagefright/HTTPDataSource.h | 5 +- include/media/stagefright/HTTPStream.h | 74 --------------- include/media/stagefright/QComHardwareRenderer.h | 57 ------------ include/media/stagefright/SampleTable.h | 109 ----------------------- include/media/stagefright/SoftwareRenderer.h | 59 ------------ include/media/stagefright/TIHardwareRenderer.h | 59 ------------ include/media/stagefright/TimedEventQueue.h | 106 ---------------------- include/media/stagefright/string.h | 54 ----------- 9 files changed, 3 insertions(+), 584 deletions(-) delete mode 100644 include/media/stagefright/ESDS.h delete mode 100644 include/media/stagefright/HTTPStream.h delete mode 100644 include/media/stagefright/QComHardwareRenderer.h delete mode 100644 include/media/stagefright/SampleTable.h delete mode 100644 include/media/stagefright/SoftwareRenderer.h delete mode 100644 include/media/stagefright/TIHardwareRenderer.h delete mode 100644 include/media/stagefright/TimedEventQueue.h delete mode 100644 include/media/stagefright/string.h (limited to 'include') diff --git a/include/media/stagefright/ESDS.h b/include/media/stagefright/ESDS.h deleted file mode 100644 index 01bcd18..0000000 --- a/include/media/stagefright/ESDS.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ESDS_H_ - -#define ESDS_H_ - -#include - -#include - -namespace android { - -class ESDS { -public: - ESDS(const void *data, size_t size); - ~ESDS(); - - status_t InitCheck() const; - - status_t getCodecSpecificInfo(const void **data, size_t *size) const; - -private: - enum { - kTag_ESDescriptor = 0x03, - kTag_DecoderConfigDescriptor = 0x04, - kTag_DecoderSpecificInfo = 0x05 - }; - - uint8_t *mData; - size_t mSize; - - status_t mInitCheck; - - size_t mDecoderSpecificOffset; - size_t mDecoderSpecificLength; - - status_t skipDescriptorHeader( - size_t offset, size_t size, - uint8_t *tag, size_t *data_offset, size_t *data_size) const; - - status_t parse(); - status_t parseESDescriptor(size_t offset, size_t size); - status_t parseDecoderConfigDescriptor(size_t offset, size_t size); - - ESDS(const ESDS &); - ESDS &operator=(const ESDS &); -}; - -} // namespace android -#endif // ESDS_H_ diff --git a/include/media/stagefright/HTTPDataSource.h b/include/media/stagefright/HTTPDataSource.h index 0587c7c..02d95fd 100644 --- a/include/media/stagefright/HTTPDataSource.h +++ b/include/media/stagefright/HTTPDataSource.h @@ -19,10 +19,11 @@ #define HTTP_DATASOURCE_H_ #include -#include namespace android { +class HTTPStream; + class HTTPDataSource : public DataSource { public: HTTPDataSource(const char *host, int port, const char *path); @@ -40,7 +41,7 @@ private: kBufferSize = 64 * 1024 }; - HTTPStream mHttp; + HTTPStream *mHttp; char *mHost; int mPort; char *mPath; diff --git a/include/media/stagefright/HTTPStream.h b/include/media/stagefright/HTTPStream.h deleted file mode 100644 index 3d0d67a..0000000 --- a/include/media/stagefright/HTTPStream.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef HTTP_STREAM_H_ - -#define HTTP_STREAM_H_ - -#include - -#include -#include -#include - -namespace android { - -class HTTPStream { -public: - HTTPStream(); - ~HTTPStream(); - - status_t connect(const char *server, int port = 80); - status_t disconnect(); - - status_t send(const char *data, size_t size); - - // Assumes data is a '\0' terminated string. - status_t send(const char *data); - - // Receive up to "size" bytes of data. - ssize_t receive(void *data, size_t size); - - status_t receive_header(int *http_status); - - // The header key used to retrieve the status line. - static const char *kStatusKey; - - bool find_header_value( - const string &key, string *value) const; - -private: - enum State { - READY, - CONNECTED - }; - - State mState; - int mSocket; - - KeyedVector mHeaders; - - // Receive a line of data terminated by CRLF, line will be '\0' terminated - // _excluding_ the termianting CRLF. - status_t receive_line(char *line, size_t size); - - HTTPStream(const HTTPStream &); - HTTPStream &operator=(const HTTPStream &); -}; - -} // namespace android - -#endif // HTTP_STREAM_H_ diff --git a/include/media/stagefright/QComHardwareRenderer.h b/include/media/stagefright/QComHardwareRenderer.h deleted file mode 100644 index 8292dd5..0000000 --- a/include/media/stagefright/QComHardwareRenderer.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef QCOM_HARDWARE_RENDERER_H_ - -#define QCOM_HARDWARE_RENDERER_H_ - -#include -#include - -namespace android { - -class ISurface; -class MemoryHeapPmem; - -class QComHardwareRenderer : public VideoRenderer { -public: - QComHardwareRenderer( - const sp &surface, - size_t displayWidth, size_t displayHeight, - size_t decodedWidth, size_t decodedHeight); - - virtual ~QComHardwareRenderer(); - - virtual void render( - const void *data, size_t size, void *platformPrivate); - -private: - sp mISurface; - size_t mDisplayWidth, mDisplayHeight; - size_t mDecodedWidth, mDecodedHeight; - size_t mFrameSize; - sp mMemoryHeap; - - bool getOffset(void *platformPrivate, size_t *offset); - void publishBuffers(uint32_t pmem_fd); - - QComHardwareRenderer(const QComHardwareRenderer &); - QComHardwareRenderer &operator=(const QComHardwareRenderer &); -}; - -} // namespace android - -#endif // QCOM_HARDWARE_RENDERER_H_ diff --git a/include/media/stagefright/SampleTable.h b/include/media/stagefright/SampleTable.h deleted file mode 100644 index 34a0649..0000000 --- a/include/media/stagefright/SampleTable.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SAMPLE_TABLE_H_ - -#define SAMPLE_TABLE_H_ - -#include -#include - -#include -#include -#include - -namespace android { - -class DataSource; - -class SampleTable : public RefBase { -public: - SampleTable(const sp &source); - - // type can be 'stco' or 'co64'. - status_t setChunkOffsetParams( - uint32_t type, off_t data_offset, size_t data_size); - - status_t setSampleToChunkParams(off_t data_offset, size_t data_size); - - // type can be 'stsz' or 'stz2'. - status_t setSampleSizeParams( - uint32_t type, off_t data_offset, size_t data_size); - - status_t setTimeToSampleParams(off_t data_offset, size_t data_size); - - status_t setSyncSampleParams(off_t data_offset, size_t data_size); - - //////////////////////////////////////////////////////////////////////////// - - uint32_t countChunkOffsets() const; - status_t getChunkOffset(uint32_t chunk_index, off_t *offset); - - status_t getChunkForSample( - uint32_t sample_index, uint32_t *chunk_index, - uint32_t *chunk_relative_sample_index, uint32_t *desc_index); - - uint32_t countSamples() const; - status_t getSampleSize(uint32_t sample_index, size_t *sample_size); - - status_t getSampleOffsetAndSize( - uint32_t sample_index, off_t *offset, size_t *size); - - status_t getMaxSampleSize(size_t *size); - - status_t getDecodingTime(uint32_t sample_index, uint32_t *time); - - enum { - kSyncSample_Flag = 1 - }; - status_t findClosestSample( - uint32_t req_time, uint32_t *sample_index, uint32_t flags); - - status_t findClosestSyncSample( - uint32_t start_sample_index, uint32_t *sample_index); - -protected: - ~SampleTable(); - -private: - sp mDataSource; - Mutex mLock; - - off_t mChunkOffsetOffset; - uint32_t mChunkOffsetType; - uint32_t mNumChunkOffsets; - - off_t mSampleToChunkOffset; - uint32_t mNumSampleToChunkOffsets; - - off_t mSampleSizeOffset; - uint32_t mSampleSizeFieldSize; - uint32_t mDefaultSampleSize; - uint32_t mNumSampleSizes; - - uint32_t mTimeToSampleCount; - uint32_t *mTimeToSample; - - off_t mSyncSampleOffset; - uint32_t mNumSyncSamples; - - SampleTable(const SampleTable &); - SampleTable &operator=(const SampleTable &); -}; - -} // namespace android - -#endif // SAMPLE_TABLE_H_ diff --git a/include/media/stagefright/SoftwareRenderer.h b/include/media/stagefright/SoftwareRenderer.h deleted file mode 100644 index 9eed089..0000000 --- a/include/media/stagefright/SoftwareRenderer.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SOFTWARE_RENDERER_H_ - -#define SOFTWARE_RENDERER_H_ - -#include -#include -#include - -namespace android { - -class ISurface; -class MemoryHeapBase; - -class SoftwareRenderer : public VideoRenderer { -public: - SoftwareRenderer( - OMX_COLOR_FORMATTYPE colorFormat, - const sp &surface, - size_t displayWidth, size_t displayHeight, - size_t decodedWidth, size_t decodedHeight); - - virtual ~SoftwareRenderer(); - - virtual void render( - const void *data, size_t size, void *platformPrivate); - -private: - OMX_COLOR_FORMATTYPE mColorFormat; - ColorConverter mConverter; - sp mISurface; - size_t mDisplayWidth, mDisplayHeight; - size_t mDecodedWidth, mDecodedHeight; - size_t mFrameSize; - sp mMemoryHeap; - int mIndex; - - SoftwareRenderer(const SoftwareRenderer &); - SoftwareRenderer &operator=(const SoftwareRenderer &); -}; - -} // namespace android - -#endif // SOFTWARE_RENDERER_H_ diff --git a/include/media/stagefright/TIHardwareRenderer.h b/include/media/stagefright/TIHardwareRenderer.h deleted file mode 100644 index ef42648..0000000 --- a/include/media/stagefright/TIHardwareRenderer.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TI_HARDWARE_RENDERER_H_ - -#define TI_HARDWARE_RENDERER_H_ - -#include -#include -#include - -namespace android { - -class ISurface; -class Overlay; - -class TIHardwareRenderer : public VideoRenderer { -public: - TIHardwareRenderer( - const sp &surface, - size_t displayWidth, size_t displayHeight, - size_t decodedWidth, size_t decodedHeight); - - virtual ~TIHardwareRenderer(); - - virtual void render( - const void *data, size_t size, void *platformPrivate); - -private: - sp mISurface; - size_t mDisplayWidth, mDisplayHeight; - size_t mDecodedWidth, mDecodedHeight; - size_t mFrameSize; - sp mOverlay; - Vector mOverlayAddresses; - bool mIsFirstFrame; - size_t mIndex; - - TIHardwareRenderer(const TIHardwareRenderer &); - TIHardwareRenderer &operator=(const TIHardwareRenderer &); -}; - -} // namespace android - -#endif // TI_HARDWARE_RENDERER_H_ - diff --git a/include/media/stagefright/TimedEventQueue.h b/include/media/stagefright/TimedEventQueue.h deleted file mode 100644 index a264421..0000000 --- a/include/media/stagefright/TimedEventQueue.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TIMED_EVENT_QUEUE_H_ - -#define TIMED_EVENT_QUEUE_H_ - -#include - -#include -#include -#include - -namespace android { - -struct TimedEventQueue { - - struct Event : public RefBase { - Event() {} - virtual ~Event() {} - - protected: - virtual void fire(TimedEventQueue *queue, int64_t now_us) = 0; - - private: - friend class TimedEventQueue; - - Event(const Event &); - Event &operator=(const Event &); - }; - - TimedEventQueue(); - ~TimedEventQueue(); - - // Start executing the event loop. - void start(); - - // Stop executing the event loop, if flush is false, any pending - // events are discarded, otherwise the queue will stop (and this call - // return) once all pending events have been handled. - void stop(bool flush = false); - - // Posts an event to the front of the queue (after all events that - // have previously been posted to the front but before timed events). - void postEvent(const sp &event); - - void postEventToBack(const sp &event); - - // It is an error to post an event with a negative delay. - void postEventWithDelay(const sp &event, int64_t delay_us); - - // If the event is to be posted at a time that has already passed, - // it will fire as soon as possible. - void postTimedEvent(const sp &event, int64_t realtime_us); - - // Returns true iff event is currently in the queue and has been - // successfully cancelled. In this case the event will have been - // removed from the queue and won't fire. - bool cancelEvent(const sp &event); - - static int64_t getRealTimeUs(); - -private: - struct QueueItem { - sp event; - int64_t realtime_us; - }; - - struct StopEvent : public TimedEventQueue::Event { - virtual void fire(TimedEventQueue *queue, int64_t now_us) { - queue->mStopped = true; - } - }; - - pthread_t mThread; - List mQueue; - Mutex mLock; - Condition mQueueNotEmptyCondition; - Condition mQueueHeadChangedCondition; - - bool mRunning; - bool mStopped; - - static void *ThreadWrapper(void *me); - void threadEntry(); - - TimedEventQueue(const TimedEventQueue &); - TimedEventQueue &operator=(const TimedEventQueue &); -}; - -} // namespace android - -#endif // TIMED_EVENT_QUEUE_H_ diff --git a/include/media/stagefright/string.h b/include/media/stagefright/string.h deleted file mode 100644 index 5dc7116..0000000 --- a/include/media/stagefright/string.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef STRING_H_ - -#define STRING_H_ - -#include - -namespace android { - -class string { -public: - typedef size_t size_type; - static size_type npos; - - string(); - string(const char *s); - string(const char *s, size_t length); - string(const string &from, size_type start, size_type length = npos); - - const char *c_str() const; - size_type size() const; - - void clear(); - void erase(size_type from, size_type length); - - size_type find(char c) const; - - bool operator<(const string &other) const; - bool operator==(const string &other) const; - - string &operator+=(char c); - -private: - String8 mString; -}; - -} // namespace android - -#endif // STRING_H_ -- cgit v1.1