content/media/BufferDecoder.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #include "BufferDecoder.h"
     9 #include "nsISupports.h"
    10 #include "MediaResource.h"
    12 namespace mozilla {
    14 #ifdef PR_LOGGING
    15 extern PRLogModuleInfo* gMediaDecoderLog;
    16 #endif
    18 NS_IMPL_ISUPPORTS0(BufferDecoder)
    20 BufferDecoder::BufferDecoder(MediaResource* aResource)
    21   : mReentrantMonitor("BufferDecoder")
    22   , mResource(aResource)
    23 {
    24   MOZ_ASSERT(NS_IsMainThread());
    25   MOZ_COUNT_CTOR(BufferDecoder);
    26 #ifdef PR_LOGGING
    27   if (!gMediaDecoderLog) {
    28     gMediaDecoderLog = PR_NewLogModule("MediaDecoder");
    29   }
    30 #endif
    31 }
    33 BufferDecoder::~BufferDecoder()
    34 {
    35   // The dtor may run on any thread, we cannot be sure.
    36   MOZ_COUNT_DTOR(BufferDecoder);
    37 }
    39 void
    40 BufferDecoder::BeginDecoding(nsIThread* aDecodeThread)
    41 {
    42   MOZ_ASSERT(!mDecodeThread && aDecodeThread);
    43   mDecodeThread = aDecodeThread;
    44 }
    46 ReentrantMonitor&
    47 BufferDecoder::GetReentrantMonitor()
    48 {
    49   return mReentrantMonitor;
    50 }
    52 bool
    53 BufferDecoder::IsShutdown() const
    54 {
    55   // BufferDecoder cannot be shut down.
    56   return false;
    57 }
    59 bool
    60 BufferDecoder::OnStateMachineThread() const
    61 {
    62   // BufferDecoder doesn't have the concept of a state machine.
    63   return true;
    64 }
    66 bool
    67 BufferDecoder::OnDecodeThread() const
    68 {
    69   MOZ_ASSERT(mDecodeThread, "Forgot to call BeginDecoding?");
    70   return IsCurrentThread(mDecodeThread);
    71 }
    73 MediaResource*
    74 BufferDecoder::GetResource() const
    75 {
    76   return mResource;
    77 }
    79 void
    80 BufferDecoder::NotifyBytesConsumed(int64_t aBytes, int64_t aOffset)
    81 {
    82   // ignore
    83 }
    85 void
    86 BufferDecoder::NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded)
    87 {
    88   // ignore
    89 }
    91 int64_t
    92 BufferDecoder::GetEndMediaTime() const
    93 {
    94   // unknown
    95   return -1;
    96 }
    98 int64_t
    99 BufferDecoder::GetMediaDuration()
   100 {
   101   // unknown
   102   return -1;
   103 }
   105 void
   106 BufferDecoder::SetMediaDuration(int64_t aDuration)
   107 {
   108   // ignore
   109 }
   111 void
   112 BufferDecoder::UpdateEstimatedMediaDuration(int64_t aDuration)
   113 {
   114   // ignore
   115 }
   117 void
   118 BufferDecoder::SetMediaSeekable(bool aMediaSeekable)
   119 {
   120   // ignore
   121 }
   123 void
   124 BufferDecoder::SetTransportSeekable(bool aTransportSeekable)
   125 {
   126   // ignore
   127 }
   129 VideoFrameContainer*
   130 BufferDecoder::GetVideoFrameContainer()
   131 {
   132   // no video frame
   133   return nullptr;
   134 }
   136 layers::ImageContainer*
   137 BufferDecoder::GetImageContainer()
   138 {
   139   // no image container
   140   return nullptr;
   141 }
   143 bool
   144 BufferDecoder::IsTransportSeekable()
   145 {
   146   return false;
   147 }
   149 bool
   150 BufferDecoder::IsMediaSeekable()
   151 {
   152   return false;
   153 }
   155 void
   156 BufferDecoder::MetadataLoaded(int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags)
   157 {
   158   // ignore
   159 }
   161 void
   162 BufferDecoder::QueueMetadata(int64_t aTime, int aChannels, int aRate, bool aHasAudio, bool aHasVideo, MetadataTags* aTags)
   163 {
   164   // ignore
   165 }
   167 void
   168 BufferDecoder::SetMediaEndTime(int64_t aTime)
   169 {
   170   // ignore
   171 }
   173 void
   174 BufferDecoder::UpdatePlaybackPosition(int64_t aTime)
   175 {
   176   // ignore
   177 }
   179 void
   180 BufferDecoder::OnReadMetadataCompleted()
   181 {
   182   // ignore
   183 }
   185 void
   186 BufferDecoder::NotifyWaitingForResourcesStatusChanged()
   187 {
   188   // ignore
   189 }
   191 MediaDecoderOwner*
   192 BufferDecoder::GetOwner()
   193 {
   194   // unknown
   195   return nullptr;
   196 }
   198 } // namespace mozilla

mercurial