summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/include/XINGSeeker.h
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-11-09 08:57:45 -0800
committerAndreas Huber <andih@google.com>2010-11-09 14:45:08 -0800
commit4456da54bcd206ed1f518c69cc959ca65a179c83 (patch)
tree56fa8c8a3105cda3861c842d080abfae53526816 /media/libstagefright/include/XINGSeeker.h
parent30db2709395c73fb3b4ee334119ceba68c95ab13 (diff)
downloadframeworks_av-4456da54bcd206ed1f518c69cc959ca65a179c83.zip
frameworks_av-4456da54bcd206ed1f518c69cc959ca65a179c83.tar.gz
frameworks_av-4456da54bcd206ed1f518c69cc959ca65a179c83.tar.bz2
Some refactoring and added support for another form of vbr headers.
related-to-bug: 3172324 Change-Id: Ic364da09eac7f0a815f9ceb719b6baa8a76e3730
Diffstat (limited to 'media/libstagefright/include/XINGSeeker.h')
-rw-r--r--media/libstagefright/include/XINGSeeker.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/media/libstagefright/include/XINGSeeker.h b/media/libstagefright/include/XINGSeeker.h
new file mode 100644
index 0000000..d4ff4e1
--- /dev/null
+++ b/media/libstagefright/include/XINGSeeker.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 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 XING_SEEKER_H_
+
+#define XING_SEEKER_H_
+
+#include "include/MP3Seeker.h"
+
+namespace android {
+
+struct DataSource;
+
+struct XINGSeeker : public MP3Seeker {
+ static sp<XINGSeeker> CreateFromSource(
+ const sp<DataSource> &source, off_t first_frame_pos);
+
+ virtual bool getDuration(int64_t *durationUs);
+ virtual bool getOffsetForTime(int64_t *timeUs, off_t *pos);
+
+private:
+ int64_t mFirstFramePos;
+ int64_t mDurationUs;
+ int32_t mSizeBytes;
+
+ // TOC entries in XING header. Skip the first one since it's always 0.
+ char mTableOfContents[99];
+
+ XINGSeeker();
+
+ DISALLOW_EVIL_CONSTRUCTORS(XINGSeeker);
+};
+
+} // namespace android
+
+#endif // XING_SEEKER_H_
+