From 5a1c3529e4fa2f8a11054181294e0ce79fff8dd3 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 25 Aug 2010 11:09:41 -0700 Subject: Allow sniffers to return a packet of opaque data that the corresponding extractor can take advantage of to not duplicate work already done sniffing. The mp3 extractor takes advantage of this now. Change-Id: Icb77ae3ee95a69c7da25b4d3b8696c0a2d33028a related-to-bug: 2948754 --- include/media/stagefright/DataSource.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/media/stagefright/DataSource.h') diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index 6f7dc38..9d2cff6 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -28,6 +28,7 @@ namespace android { +struct AMessage; class String8; class DataSource : public RefBase { @@ -59,10 +60,14 @@ public: //////////////////////////////////////////////////////////////////////////// - bool sniff(String8 *mimeType, float *confidence); + bool sniff(String8 *mimeType, float *confidence, sp *meta); + // The sniffer can optionally fill in "meta" with an AMessage containing + // a dictionary of values that helps the corresponding extractor initialize + // its state without duplicating effort already exerted by the sniffer. typedef bool (*SnifferFunc)( - const sp &source, String8 *mimeType, float *confidence); + const sp &source, String8 *mimeType, + float *confidence, sp *meta); static void RegisterSniffer(SnifferFunc func); static void RegisterDefaultSniffers(); -- cgit v1.1