MPEG1or2DemuxedElementaryStream.hh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**********
  2. This library is free software; you can redistribute it and/or modify it under
  3. the terms of the GNU Lesser General Public License as published by the
  4. Free Software Foundation; either version 3 of the License, or (at your
  5. option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
  6. This library is distributed in the hope that it will be useful, but WITHOUT
  7. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
  9. more details.
  10. You should have received a copy of the GNU Lesser General Public License
  11. along with this library; if not, write to the Free Software Foundation, Inc.,
  12. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  13. **********/
  14. // "liveMedia"
  15. // Copyright (c) 1996-2019 Live Networks, Inc. All rights reserved.
  16. // A MPEG 1 or 2 Elementary Stream, demultiplexed from a Program Stream
  17. // C++ header
  18. #ifndef _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH
  19. #define _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH
  20. #ifndef _MPEG_1OR2_DEMUX_HH
  21. #include "MPEG1or2Demux.hh"
  22. #endif
  23. class MPEG1or2DemuxedElementaryStream: public FramedSource {
  24. public:
  25. MPEG1or2Demux::SCR lastSeenSCR() const { return fLastSeenSCR; }
  26. unsigned char mpegVersion() const { return fMPEGversion; }
  27. MPEG1or2Demux& sourceDemux() const { return fOurSourceDemux; }
  28. private: // We are created only by a MPEG1or2Demux (a friend)
  29. MPEG1or2DemuxedElementaryStream(UsageEnvironment& env,
  30. u_int8_t streamIdTag,
  31. MPEG1or2Demux& sourceDemux);
  32. virtual ~MPEG1or2DemuxedElementaryStream();
  33. private:
  34. // redefined virtual functions:
  35. virtual void doGetNextFrame();
  36. virtual void doStopGettingFrames();
  37. virtual char const* MIMEtype() const;
  38. virtual unsigned maxFrameSize() const;
  39. private:
  40. static void afterGettingFrame(void* clientData,
  41. unsigned frameSize, unsigned numTruncatedBytes,
  42. struct timeval presentationTime,
  43. unsigned durationInMicroseconds);
  44. void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes,
  45. struct timeval presentationTime,
  46. unsigned durationInMicroseconds);
  47. private:
  48. u_int8_t fOurStreamIdTag;
  49. MPEG1or2Demux& fOurSourceDemux;
  50. char const* fMIMEtype;
  51. MPEG1or2Demux::SCR fLastSeenSCR;
  52. unsigned char fMPEGversion;
  53. friend class MPEG1or2Demux;
  54. };
  55. #endif