tdav_video_frame.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. /**@file tdav_video_frame.h
  23. * @brief Video Frame
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango(DOT)org>
  26. */
  27. #ifndef TINYDAV_VIDEO_JB_FRAME_H
  28. #define TINYDAV_VIDEO_JB_FRAME_H
  29. #include "tinydav_config.h"
  30. #include "tinyrtp/rtp/trtp_rtp_packet.h"
  31. #include "tsk_safeobj.h"
  32. #include "tsk_list.h"
  33. TDAV_BEGIN_DECLS
  34. #define TDAV_VIDEO_FRAME(self) ((tdav_video_frame_t*)(self))
  35. typedef uint16_t tdav_video_frame_seq_nums[16];
  36. typedef tsk_list_t tdav_video_frames_L_t;
  37. typedef struct tdav_video_frame_s {
  38. TSK_DECLARE_OBJECT;
  39. uint8_t payload_type;
  40. uint32_t timestamp;
  41. uint16_t highest_seq_num;
  42. uint32_t ssrc;
  43. trtp_rtp_packets_L_t* pkts;
  44. TSK_DECLARE_SAFEOBJ;
  45. }
  46. tdav_video_frame_t;
  47. struct tdav_video_frame_s* tdav_video_frame_create(struct trtp_rtp_packet_s* rtp_pkt);
  48. int tdav_video_frame_put(struct tdav_video_frame_s* self, struct trtp_rtp_packet_s* rtp_pkt);
  49. const struct trtp_rtp_packet_s* tdav_video_frame_find_by_seq_num(const struct tdav_video_frame_s* self, uint16_t seq_num);
  50. tsk_size_t tdav_video_frame_write(struct tdav_video_frame_s* self, void** buffer_ptr, tsk_size_t* buffer_size);
  51. tsk_bool_t tdav_video_frame_is_complete(const struct tdav_video_frame_s* self, int32_t last_seq_num_with_mark, int32_t* missing_seq_num_start, int32_t* missing_seq_num_count);
  52. #define tdav_video_frame_is_complete_2(self, last_seq_num_with_mark) tdav_video_frame_is_complete((self), (last_seq_num_with_mark), tsk_null, tsk_null)
  53. TDAV_END_DECLS
  54. #endif /* TINYDAV_VIDEO_JB_FRAME_H */