tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

RemoteAudioDecoder.h (2260B)


      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/. */
      6 #ifndef include_dom_media_ipc_RemoteAudioDecoderChild_h
      7 #define include_dom_media_ipc_RemoteAudioDecoderChild_h
      8 #include "RemoteDecoderChild.h"
      9 #include "RemoteDecoderParent.h"
     10 
     11 namespace mozilla {
     12 
     13 using mozilla::ipc::IPCResult;
     14 
     15 class RemoteAudioDecoderChild final : public RemoteDecoderChild {
     16 public:
     17  explicit RemoteAudioDecoderChild(RemoteMediaIn aLocation);
     18 
     19  MOZ_IS_CLASS_INIT
     20  MediaResult InitIPDL(const AudioInfo& aAudioInfo,
     21                       const CreateDecoderParams::OptionSet& aOptions,
     22                       const Maybe<uint64_t>& aMediaEngineId,
     23                       PRemoteCDMActor* aCDM);
     24 
     25  MediaResult ProcessOutput(DecodedOutputIPDL&& aDecodedData) override;
     26 };
     27 
     28 class RemoteAudioDecoderParent final : public RemoteDecoderParent {
     29 public:
     30  RemoteAudioDecoderParent(RemoteMediaManagerParent* aParent,
     31                           const AudioInfo& aAudioInfo,
     32                           const CreateDecoderParams::OptionSet& aOptions,
     33                           nsISerialEventTarget* aManagerThread,
     34                           TaskQueue* aDecodeTaskQueue,
     35                           Maybe<uint64_t> aMediaEngineId,
     36                           RemoteCDMParent* aCDM);
     37 
     38 protected:
     39  IPCResult RecvConstruct(ConstructResolver&& aResolver) override;
     40  MediaResult ProcessDecodedData(MediaDataDecoder::DecodedData&& aData,
     41                                 DecodedOutputIPDL& aDecodedData) override;
     42 
     43 private:
     44  // Can only be accessed from the manager thread
     45  // Note: we can't keep a reference to the original AudioInfo here
     46  // because unlike in typical MediaDataDecoder situations, we're being
     47  // passed a deserialized AudioInfo from RecvPRemoteDecoderConstructor
     48  // which is destroyed when RecvPRemoteDecoderConstructor returns.
     49  const AudioInfo mAudioInfo;
     50  const CreateDecoderParams::OptionSet mOptions;
     51 };
     52 
     53 }  // namespace mozilla
     54 
     55 #endif  // include_dom_media_ipc_RemoteAudioDecoderChild_h