Class ProviderService

java.lang.Object
org.red5.server.stream.ProviderService
All Implemented Interfaces:
IScopeService, IProviderService

public class ProviderService extends Object implements IProviderService
  • Field Details

    • log

      private static final org.slf4j.Logger log
  • Constructor Details

    • ProviderService

      public ProviderService()
  • Method Details

    • lookupProviderInput

      public IProviderService.INPUT_TYPE lookupProviderInput(IScope scope, String name, int type)
      Returns the input type for a named provider if a source of input exists. Live is checked first and VOD second.
      Specified by:
      lookupProviderInput in interface IProviderService
      Parameters:
      scope - Scope of provider
      name - Name of provider
      type - Type of video stream
      Returns:
      LIVE if live, VOD if VOD, and NOT_FOUND otherwise
    • getProviderInput

      public IMessageInput getProviderInput(IScope scope, String name)
      Get a named provider as the source of input. Live stream first, VOD stream second.
      Specified by:
      getProviderInput in interface IProviderService
      Parameters:
      scope - Scope of provider
      name - Name of provider
      Returns:
      null if nothing found.
    • getLiveProviderInput

      public IMessageInput getLiveProviderInput(IScope scope, String name, boolean needCreate)
      Get a named Live provider as the source of input.
      Specified by:
      getLiveProviderInput in interface IProviderService
      Parameters:
      scope - Scope of provider
      name - Name of provider
      needCreate - Whether there's need to create basic scope / live provider if they don't exist
      Returns:
      null if not found.
    • getVODProviderInput

      public IMessageInput getVODProviderInput(IScope scope, String name)
      Get a named VOD provider as the source of input.
      Specified by:
      getVODProviderInput in interface IProviderService
      Parameters:
      scope - Scope of provider
      name - Name of provider
      Returns:
      null if not found.
    • getVODProviderFile

      public File getVODProviderFile(IScope scope, String name)
      Get a named VOD source file.
      Specified by:
      getVODProviderFile in interface IProviderService
      Parameters:
      scope - Scope of provider
      name - Name of provider
      Returns:
      null if not found.
    • registerBroadcastStream

      public boolean registerBroadcastStream(IScope scope, String name, IBroadcastStream bs)
      Register a broadcast stream to a scope.
      Specified by:
      registerBroadcastStream in interface IProviderService
      Parameters:
      scope - Scope
      name - Name of stream
      bs - Broadcast stream to register
      Returns:
      true if register successfully.
    • getBroadcastStreamNames

      public Set<String> getBroadcastStreamNames(IScope scope)
      Get names of existing broadcast streams in a scope.
      Specified by:
      getBroadcastStreamNames in interface IProviderService
      Parameters:
      scope - Scope to get stream names from
      Returns:
      List of stream names
    • unregisterBroadcastStream

      public boolean unregisterBroadcastStream(IScope scope, String name)
      Unregister a broadcast stream of a specific name from a scope.
      Specified by:
      unregisterBroadcastStream in interface IProviderService
      Parameters:
      scope - Scope
      name - Stream name
      Returns:
      true if unregister successfully.
    • unregisterBroadcastStream

      public boolean unregisterBroadcastStream(IScope scope, String name, IBroadcastStream bs)
      Unregister a broadcast stream of a specific name from a scope.
      Specified by:
      unregisterBroadcastStream in interface IProviderService
      Parameters:
      scope - Scope
      name - Stream name
      bs - Broadcast stream
      Returns:
      true if unregister successfully.
    • getStreamFile

      private File getStreamFile(IScope scope, String name)