FLVVideoHeader.cpp 487 B

123456789101112131415161718192021222324
  1. #include "FLVVideoHeader.h"
  2. /*
  3. (c) 2006 Nullsoft, Inc.
  4. Author: Ben Allison [email protected]
  5. */
  6. /*
  7. codecID - 4 bits - 2: Sorensen H.263, 3: Screen video, 4: On2 VP6
  8. frameType - 4 bits - 1: keyframe, 2: inter frame, 3: disposable inter frame
  9. */
  10. bool FLVVideoHeader::Read(unsigned __int8 *data, size_t size)
  11. {
  12. if (size < 1)
  13. return false; // header size too small
  14. unsigned __int8 byte = data[0];
  15. format = (byte & 0x0f) >> 0;
  16. frameType = (byte & 0xf0) >> 4;
  17. return true;
  18. }