Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. else if (p_dec->fmt_in.i_codec == VLC_CODEC_WMV3 &&
  2. p_dec->fmt_in.i_extra >= 4 &&
  3. p_header->nAllocLen >= 36)
  4. {
  5. int profile;
  6. // According to OMX IL 1.2.0 spec (4.3.33.2), the codec config
  7. // data for VC-1 Main/Simple (aka WMV3) is according to table 265
  8. // in the VC-1 spec. Most of the fields are just set with placeholders
  9. // (like framerate, hrd_buffer/rate).
  10. static const uint8_t wmv3seq[] = {
  11. 0xff, 0xff, 0xff, 0xc5, // numframes=ffffff, marker byte
  12. 0x04, 0x00, 0x00, 0x00, // marker byte
  13. 0x00, 0x00, 0x00, 0x00, // struct C, almost equal to p_extra
  14. 0x00, 0x00, 0x00, 0x00, // struct A, vert size
  15. 0x00, 0x00, 0x00, 0x00, // struct A, horiz size
  16. 0x0c, 0x00, 0x00, 0x00, // marker byte
  17. 0xff, 0xff, 0x00, 0x80, // struct B, level=4, cbr=0, hrd_buffer=ffff
  18. 0xff, 0xff, 0x00, 0x00, // struct B, hrd_rate=ffff
  19. 0xff, 0xff, 0xff, 0xff, // struct B, framerate=ffffffff
  20. };
  21. p_header->nFilledLen = sizeof(wmv3seq);
  22. memcpy(p_header->pBuffer, wmv3seq, p_header->nFilledLen);
  23. // Struct C - almost equal to the extradata
  24. memcpy(&p_header->pBuffer[8], p_dec->fmt_in.p_extra, 4);
  25. // Expand profile from the highest 2 bits to the highest 4 bits
  26. profile = p_header->pBuffer[8] >> 6;
  27. p_header->pBuffer[8] = (p_header->pBuffer[8] & 0x0f) | (profile << 4);
  28. // Fill in the height/width for struct A
  29. SetDWLE(&p_header->pBuffer[12], p_dec->fmt_in.video.i_height);
  30. SetDWLE(&p_header->pBuffer[16], p_dec->fmt_in.video.i_width);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement