LCOV - code coverage report
Current view: top level - media/libstagefright/binding/include/mp4_demuxer - ResourceStream.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 9 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 2 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* This Source Code Form is subject to the terms of the Mozilla Public
       2             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       3             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       4             : 
       5             : #ifndef RESOURCESTREAM_H_
       6             : #define RESOURCESTREAM_H_
       7             : 
       8             : #include "MediaResource.h"
       9             : #include "mp4_demuxer/Stream.h"
      10             : #include "mozilla/RefPtr.h"
      11             : 
      12             : namespace mp4_demuxer
      13             : {
      14             : 
      15             : class ResourceStream : public Stream
      16             : {
      17             : public:
      18             :   explicit ResourceStream(mozilla::MediaResource* aResource);
      19             : 
      20             :   virtual bool ReadAt(int64_t offset, void* aBuffer, size_t aCount,
      21             :                       size_t* aBytesRead) override;
      22             :   virtual bool CachedReadAt(int64_t aOffset, void* aBuffer, size_t aCount,
      23             :                             size_t* aBytesRead) override;
      24             :   virtual bool Length(int64_t* size) override;
      25             : 
      26           0 :   void Pin()
      27             :   {
      28           0 :     mResource.GetResource()->Pin();
      29           0 :     ++mPinCount;
      30           0 :   }
      31             : 
      32           0 :   void Unpin()
      33             :   {
      34           0 :     mResource.GetResource()->Unpin();
      35           0 :     MOZ_ASSERT(mPinCount);
      36           0 :     --mPinCount;
      37           0 :   }
      38             : 
      39             : protected:
      40             :   virtual ~ResourceStream();
      41             : 
      42             : private:
      43             :   mozilla::MediaResourceIndex mResource;
      44             :   uint32_t mPinCount;
      45             : };
      46             : 
      47             : }
      48             : 
      49             : #endif // RESOURCESTREAM_H_

Generated by: LCOV version 1.13