2 * Copyright (C) 2014 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24 * THE POSSIBILITY OF SUCH DAMAGE.
27 #ifndef InbandMetadataTextTrackPrivateAVF_h
28 #define InbandMetadataTextTrackPrivateAVF_h
30 #if ENABLE(VIDEO) && USE(AVFOUNDATION)
31 #include "InbandTextTrackPrivate.h"
35 #if ENABLE(DATACUE_VALUE)
36 class IncompleteMetaDataCue {
38 IncompleteMetaDataCue(double time, PassRefPtr<SerializedPlatformRepresentation> cueData)
43 ~IncompleteMetaDataCue() { }
45 RefPtr<SerializedPlatformRepresentation> cueData() const { return m_cueData; }
46 double startTime() const { return m_startTime; }
49 RefPtr<SerializedPlatformRepresentation> m_cueData;
54 class InbandMetadataTextTrackPrivateAVF : public InbandTextTrackPrivate {
56 static PassRefPtr<InbandMetadataTextTrackPrivateAVF> create(Kind, CueFormat, const AtomicString& id = emptyAtom);
58 ~InbandMetadataTextTrackPrivateAVF();
60 virtual Kind kind() const override { return m_kind; }
61 virtual AtomicString id() const override { return m_id; }
62 virtual AtomicString inBandMetadataTrackDispatchType() const override { return m_inBandMetadataTrackDispatchType; }
63 void setInBandMetadataTrackDispatchType(const AtomicString& value) { m_inBandMetadataTrackDispatchType = value; }
65 #if ENABLE(DATACUE_VALUE)
66 void addDataCue(double start, double end, PassRefPtr<SerializedPlatformRepresentation>, const String&);
67 void updatePendingCueEndTimes(double);
70 void flushPartialCues();
73 InbandMetadataTextTrackPrivateAVF(Kind, CueFormat, const AtomicString&);
77 AtomicString m_inBandMetadataTrackDispatchType;
78 double m_currentCueStartTime;
79 #if ENABLE(DATACUE_VALUE)
80 Vector<IncompleteMetaDataCue*> m_incompleteCues;
84 } // namespace WebCore
86 #endif // ENABLE(VIDEO) && USE(AVFOUNDATION)
88 #endif // InbandMetadataTextTrackPrivateAVF_h