Interface Segment

All Superinterfaces:
org.opencastproject.mediapackage.XmlElement
All Known Subinterfaces:
AudioSegment, AudioVisualSegment, VideoSegment
All Known Implementing Classes:
SegmentImpl

public interface Segment extends org.opencastproject.mediapackage.XmlElement
A video segment represents a temporal decomposition of the video stream that may have properties like text annotations attached to it.
 <complexType name="SegmentType" abstract="true">
   <complexContent>
       <extension base="mpeg7:DSType">
           <sequence>
               <choice minOccurs="0">
                   <element name="MediaInformation" type="mpeg7:MediaInformationType"/>
                   <element name="MediaInformationRef" type="mpeg7:ReferenceType"/>
                   <element name="MediaLocator" type="mpeg7:MediaLocatorType"/>
               </choice>
               <element name="StructuralUnit" type="mpeg7:ControlledTermUseType" minOccurs="0"/>
               <choice minOccurs="0">
                   <element name="CreationInformation" type="mpeg7:CreationInformationType"/>
                   <element name="CreationInformationRef" type="mpeg7:ReferenceType"/>
               </choice>
               <choice minOccurs="0">
                   <element name="UsageInformation" type="mpeg7:UsageInformationType"/>
                   <element name="UsageInformationRef" type="mpeg7:ReferenceType"/>
               </choice>
               <element name="TextAnnotation" minOccurs="0" maxOccurs="unbounded">
                   <complexType>
                       <complexContent>
                           <extension base="mpeg7:TextAnnotationType">
                               <attribute name="type" use="optional">
                                   <simpleType>
                                       <union memberTypes="mpeg7:termReferenceType string"/>
                                   </simpleType>
                               </attribute>
                           </extension>
                       </complexContent>
                   </complexType>
               </element>
               <choice minOccurs="0" maxOccurs="unbounded">
                   <element name="Semantic" type="mpeg7:SemanticType"/>
                   <element name="SemanticRef" type="mpeg7:ReferenceType"/>
               </choice>
               <element name="MatchingHint" type="mpeg7:MatchingHintType" minOccurs="0" maxOccurs="unbounded"/>
               <element name="PointOfView" type="mpeg7:PointOfViewType" minOccurs="0" maxOccurs="unbounded"/>
               <element name="Relation" type="mpeg7:RelationType" minOccurs="0" maxOccurs="unbounded"/>
           </sequence>
       </extension>
   </complexContent>
 </complexType>
 
  • Method Details

    • getIdentifier

      String getIdentifier()
      Returns the segment identifier.
      Returns:
      the identifier
    • setMediaTime

      void setMediaTime(MediaTime mediaTime)
      Sets the segment's media time constraints.
      Parameters:
      mediaTime - the media time
    • getMediaTime

      MediaTime getMediaTime()
      Returns the segment's time constraints.
      Returns:
      the media time
    • hasTextAnnotations

      boolean hasTextAnnotations()
      Returns true if the segment contains any text annotations.
      Returns:
      true if there are text annotations
    • getTextAnnotationCount

      int getTextAnnotationCount()
      Returns the number of text annotations. Note that text annotations are containers themselves, containing a number of keywords and free text entries.
      Returns:
      the number of text annotations
    • hasTextAnnotations

      boolean hasTextAnnotations(String language)
      Returns true if the segment contains text annotations in the specified language.
      Returns:
      true if there are text annotations
    • hasTextAnnotations

      boolean hasTextAnnotations(float relevance, float confidence)
      Returns true if the segment contains text annotations that satisfy the given relevance and confidence values.
      Returns:
      true if there are text annotations
    • hasTextAnnotations

      boolean hasTextAnnotations(float relevance, float confidence, String language)
      Returns true if the segment contains text annotations that satisfy the given relevance, confidence and language constraints.
      Returns:
      true if there are text annotations
    • createTextAnnotation

      TextAnnotation createTextAnnotation(float relevance, float confidence, String language)
      Creates a new text annotation that will hold keywords and free text comments.
      Parameters:
      relevance - the relevance value
      confidence - the confidence
      language - the language identifier
      Returns:
      the new text annotation
    • textAnnotations

      Iterator<TextAnnotation> textAnnotations()
      Returns this segment's text annotations.
      Returns:
      the text annotations
    • textAnnotationsByRelevance

      Iterator<TextAnnotation> textAnnotationsByRelevance()
      Returns this segment's text annotations, sorted by relevance.
      Returns:
      the text annotations
    • textAnnotationsByConfidence

      Iterator<TextAnnotation> textAnnotationsByConfidence()
      Returns this segment's text annotations, sorted by relevance.
      Returns:
      the text annotations