AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::captions::LibwebvttParserAdapter Class Reference

#include <LibwebvttParserAdapter.h>

Inheritance diagram for alexaClientSDK::captions::LibwebvttParserAdapter:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::captions::LibwebvttParserAdapter:
Collaboration graph
[legend]

Public Member Functions

CaptionParserInterface methods
void parse (CaptionFrame::MediaPlayerSourceId captionId, const CaptionData &captionData) override
 
void addListener (std::shared_ptr< CaptionFrameParseListenerInterface > parseListener) override
 
void releaseResourcesFor (CaptionFrame::MediaPlayerSourceId captionId) override
 
- Public Member Functions inherited from alexaClientSDK::captions::CaptionParserInterface
virtual ~CaptionParserInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< LibwebvttParserAdaptergetInstance ()
 

Detailed Description

A singleton implementation of the CaptionParserInterface, specified to work with the libwebvtt parsing library found at: https://github.com/alexa/webvtt

Member Function Documentation

◆ addListener()

void alexaClientSDK::captions::LibwebvttParserAdapter::addListener ( std::shared_ptr< CaptionFrameParseListenerInterface parseListener)
overridevirtual

Gives the caption parsing implementation a handle to a listener so that it can be notified when CaptionData objects have been parsed.

Parameters
parseListenerthe CaptionFrameParseListenerInterface instance which can receive the parsed objects.

Implements alexaClientSDK::captions::CaptionParserInterface.

◆ getInstance()

static std::shared_ptr<LibwebvttParserAdapter> alexaClientSDK::captions::LibwebvttParserAdapter::getInstance ( )
static

Return the singleton instance of LibwebvttParserAdapter.

Returns
The singleton instance of LibwebvttParserAdapter.

◆ parse()

void alexaClientSDK::captions::LibwebvttParserAdapter::parse ( CaptionFrame::MediaPlayerSourceId  captionId,
const CaptionData captionData 
)
overridevirtual

Start parsing the provided raw caption data. The captionId that is received here should be retained and passed along with the parsed result to the CaptionFrameParseListenerInterface. This is to keep track of which incoming CaptionData go with the outgoing parsed CaptionFrames.

Parameters
captionIdThe identifier for the incoming caption data.
captionDatathe raw, un-processed caption to parse.

Implements alexaClientSDK::captions::CaptionParserInterface.

◆ releaseResourcesFor()

void alexaClientSDK::captions::LibwebvttParserAdapter::releaseResourcesFor ( CaptionFrame::MediaPlayerSourceId  captionId)
overridevirtual

Notify the parser that resources related to this caption ID are no longer needed and can be safely released. This function might be a no-op, depending on the caption parser implementation, but is provided in case static resources are maintained between parse requests, such as if callback functions are used to communicate with the parser.

Parameters
captionIdthe ID corresponding with the resources that should be freed, should a value that was previously received with the parse() function.

Implements alexaClientSDK::captions::CaptionParserInterface.


The documentation for this class was generated from the following file:

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0