You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
3.6KB

  1. #include "avcodec.h"
  2. /* byte stream handling */
  3. typedef struct {
  4. unsigned char *buffer;
  5. unsigned char *buf_ptr, *buf_end;
  6. void *opaque;
  7. void (*write_packet)(void *opaque, UINT8 *buf, int buf_size);
  8. int (*write_seek)(void *opaque, long long offset, int whence);
  9. long long pos; /* position in the file of the current buffer */
  10. } PutByteContext;
  11. int init_put_byte(PutByteContext *s,
  12. unsigned char *buffer,
  13. int buffer_size,
  14. void *opaque,
  15. void (*write_packet)(void *opaque, UINT8 *buf, int buf_size),
  16. int (*write_seek)(void *opaque, long long offset, int whence));
  17. void put_byte(PutByteContext *s, int b);
  18. void put_buffer(PutByteContext *s, unsigned char *buf, int size);
  19. void put_le32(PutByteContext *s, unsigned int val);
  20. void put_le64(PutByteContext *s, unsigned long long val);
  21. void put_le16(PutByteContext *s, unsigned int val);
  22. void put_tag(PutByteContext *s, char *tag);
  23. long long put_seek(PutByteContext *s, long long offset, int whence);
  24. long long put_pos(PutByteContext *s);
  25. void put_flush_packet(PutByteContext *s);
  26. /* udp.c */
  27. typedef struct {
  28. int udp_socket;
  29. int max_payload_size; /* in bytes */
  30. } UDPContext;
  31. int udp_tx_open(UDPContext *s,
  32. const char *uri,
  33. int local_port);
  34. void udp_tx_close(UDPContext *s);
  35. void udp_write_data(void *opaque, UINT8 *buf, int size);
  36. /* generic functions */
  37. struct AVFormatContext;
  38. typedef struct AVFormat {
  39. char *name;
  40. char *long_name;
  41. char *mime_type;
  42. char *extensions; /* comma separated extensions */
  43. enum CodecID audio_codec;
  44. enum CodecID video_codec;
  45. int (*write_header)(struct AVFormatContext *);
  46. int (*write_audio_frame)(struct AVFormatContext *,
  47. unsigned char *buf, int size);
  48. int (*write_video_picture)(struct AVFormatContext *,
  49. unsigned char *buf, int size);
  50. int (*write_trailer)(struct AVFormatContext *);
  51. struct AVFormat *next;
  52. } AVFormat;
  53. typedef struct AVFormatContext {
  54. struct AVFormat *format;
  55. void *priv_data;
  56. PutByteContext pb;
  57. AVEncodeContext *video_enc;
  58. AVEncodeContext *audio_enc;
  59. int is_streamed; /* true if the stream is generated as being streamed */
  60. } AVFormatContext;
  61. extern AVFormat *first_format;
  62. extern int data_out_size;
  63. extern const char *comment_string;
  64. /* rv10enc.c */
  65. extern AVFormat rm_format;
  66. extern AVFormat ra_format;
  67. /* mpegmux.c */
  68. extern AVFormat mpeg_mux_format;
  69. /* asfenc.c */
  70. extern AVFormat asf_format;
  71. /* jpegenc.c */
  72. extern AVFormat mpjpeg_format;
  73. extern AVFormat jpeg_format;
  74. /* swfenc.c */
  75. extern AVFormat swf_format;
  76. /* formats.c */
  77. void register_avformat(AVFormat *format);
  78. AVFormat *guess_format(const char *short_name, const char *filename, const char *mime_type);
  79. void register_avencoder(AVEncoder *format);
  80. AVEncoder *avencoder_find(enum CodecID id);
  81. void avencoder_string(char *buf, int buf_size, AVEncodeContext *enc);
  82. int avencoder_open(AVEncodeContext *avctx, AVEncoder *codec);
  83. int avencoder_encode(AVEncodeContext *avctx, UINT8 *buf, int buf_size, void *data);
  84. int avencoder_close(AVEncodeContext *avctx);
  85. extern AVFormat mp2_format;
  86. extern AVFormat ac3_format;
  87. extern AVFormat h263_format;
  88. extern AVFormat mpeg1video_format;
  89. int strstart(const char *str, const char *val, const char **ptr);
  90. /* grab.c */
  91. extern const char *v4l_device;
  92. long long gettime(void);
  93. int v4l_init(int rate, int width, int height);
  94. int v4l_read_picture(UINT8 *picture[3],
  95. int width, int height,
  96. int picture_number);
  97. int audio_open(int freq, int channels);