tdav_codec_h261.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango.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_codec_h261.h
  23. * @brief H.261 codec plugin.
  24. * RTP payloader follows RFC 4587
  25. *
  26. * @author Mamadou Diop <diopmamadou(at)doubango.org>
  27. *
  28. */
  29. #ifndef TINYDAV_CODEC_H261_H
  30. #define TINYDAV_CODEC_H261_H
  31. #include "tinydav_config.h"
  32. #if HAVE_FFMPEG
  33. #include "tinymedia/tmedia_codec.h"
  34. #include <libavcodec/avcodec.h>
  35. TDAV_BEGIN_DECLS
  36. #define TDAV_CODEC_H261(self) ((tdav_codec_h261_t*)(self))
  37. /** H.2261 codec */
  38. typedef struct tdav_codec_h261_s {
  39. TMEDIA_DECLARE_CODEC_VIDEO;
  40. struct {
  41. uint8_t* ptr;
  42. tsk_size_t size;
  43. } rtp;
  44. // Encoder
  45. struct {
  46. AVCodec* codec;
  47. AVCodecContext* context;
  48. AVFrame* picture;
  49. void* buffer;
  50. } encoder;
  51. // decoder
  52. struct {
  53. AVCodec* codec;
  54. AVCodecContext* context;
  55. AVFrame* picture;
  56. void* accumulator;
  57. uint8_t ebit;
  58. tsk_size_t accumulator_pos;
  59. uint16_t last_seq;
  60. } decoder;
  61. }
  62. tdav_codec_h261_t;
  63. TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h261_plugin_def_t;
  64. tsk_bool_t tdav_codec_ffmpeg_h261_is_supported();
  65. TDAV_END_DECLS
  66. #endif /* HAVE_FFMPEG */
  67. #endif /* TINYDAV_CODEC_H261_H */