comparison utils.c @ 4552:c31d78661cf2 libavcodec

Add some more Doxygen documentation to libavcodec/utils.c.
author takis
date Tue, 20 Feb 2007 12:45:16 +0000
parents 30b8672a2357
children 4d1b45b20f8c
comparison
equal deleted inserted replaced
4551:c0bf618fbe7e 4552:c31d78661cf2
741 #undef D 741 #undef D
742 #undef DEFAULT 742 #undef DEFAULT
743 743
744 static AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options }; 744 static AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options };
745 745
746 /**
747 * Sets the fields of the given AVCodecContext to default values.
748 *
749 * @param s The AVCodecContext of which the fields should be set to default values.
750 */
746 void avcodec_get_context_defaults(AVCodecContext *s){ 751 void avcodec_get_context_defaults(AVCodecContext *s){
747 memset(s, 0, sizeof(AVCodecContext)); 752 memset(s, 0, sizeof(AVCodecContext));
748 753
749 s->av_class= &av_codec_context_class; 754 s->av_class= &av_codec_context_class;
750 755
763 s->palctrl = NULL; 768 s->palctrl = NULL;
764 s->reget_buffer= avcodec_default_reget_buffer; 769 s->reget_buffer= avcodec_default_reget_buffer;
765 } 770 }
766 771
767 /** 772 /**
768 * allocates a AVCodecContext and set it to defaults. 773 * Allocates an AVCodecContext and sets its fields to default values. The
769 * this can be deallocated by simply calling free() 774 * resulting struct can be deallocated by simply calling av_free().
775 *
776 * @return An AVCodecContext filled with default values or NULL on failure.
777 * @see avcodec_get_context_defaults
770 */ 778 */
771 AVCodecContext *avcodec_alloc_context(void){ 779 AVCodecContext *avcodec_alloc_context(void){
772 AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); 780 AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
773 781
774 if(avctx==NULL) return NULL; 782 if(avctx==NULL) return NULL;
776 avcodec_get_context_defaults(avctx); 784 avcodec_get_context_defaults(avctx);
777 785
778 return avctx; 786 return avctx;
779 } 787 }
780 788
789 /**
790 * Sets its fields of the given AVFrame to default values.
791 *
792 * @param pic The AVFrame of which the fields should be set to default values.
793 */
781 void avcodec_get_frame_defaults(AVFrame *pic){ 794 void avcodec_get_frame_defaults(AVFrame *pic){
782 memset(pic, 0, sizeof(AVFrame)); 795 memset(pic, 0, sizeof(AVFrame));
783 796
784 pic->pts= AV_NOPTS_VALUE; 797 pic->pts= AV_NOPTS_VALUE;
785 pic->key_frame= 1; 798 pic->key_frame= 1;
786 } 799 }
787 800
788 /** 801 /**
789 * allocates a AVPFrame and set it to defaults. 802 * Allocates an AVFrame and sets its fields to default values. The resulting
790 * this can be deallocated by simply calling free() 803 * struct can be deallocated by simply calling av_free().
804 *
805 * @return An AVFrame filled with default values or NULL on failure.
806 * @see avcodec_get_frame_defaults
791 */ 807 */
792 AVFrame *avcodec_alloc_frame(void){ 808 AVFrame *avcodec_alloc_frame(void){
793 AVFrame *pic= av_malloc(sizeof(AVFrame)); 809 AVFrame *pic= av_malloc(sizeof(AVFrame));
794 810
795 if(pic==NULL) return NULL; 811 if(pic==NULL) return NULL;
1002 avctx->codec = NULL; 1018 avctx->codec = NULL;
1003 entangled_thread_counter--; 1019 entangled_thread_counter--;
1004 return 0; 1020 return 0;
1005 } 1021 }
1006 1022
1023 /**
1024 * Find an encoder with a matching codec ID.
1025 *
1026 * @param id CodecID of the requested encoder.
1027 * @return An encoder if one was found, NULL otherwise.
1028 */
1007 AVCodec *avcodec_find_encoder(enum CodecID id) 1029 AVCodec *avcodec_find_encoder(enum CodecID id)
1008 { 1030 {
1009 AVCodec *p; 1031 AVCodec *p;
1010 p = first_avcodec; 1032 p = first_avcodec;
1011 while (p) { 1033 while (p) {
1014 p = p->next; 1036 p = p->next;
1015 } 1037 }
1016 return NULL; 1038 return NULL;
1017 } 1039 }
1018 1040
1041 /**
1042 * Find an encoder with the specified name.
1043 *
1044 * @param name Name of the requested encoder.
1045 * @return An encoder if one was found, NULL otherwise.
1046 */
1019 AVCodec *avcodec_find_encoder_by_name(const char *name) 1047 AVCodec *avcodec_find_encoder_by_name(const char *name)
1020 { 1048 {
1021 AVCodec *p; 1049 AVCodec *p;
1022 p = first_avcodec; 1050 p = first_avcodec;
1023 while (p) { 1051 while (p) {
1026 p = p->next; 1054 p = p->next;
1027 } 1055 }
1028 return NULL; 1056 return NULL;
1029 } 1057 }
1030 1058
1059 /**
1060 * Find a decoder with a matching codec ID.
1061 *
1062 * @param id CodecID of the requested decoder.
1063 * @return An decoder if one was found, NULL otherwise.
1064 */
1031 AVCodec *avcodec_find_decoder(enum CodecID id) 1065 AVCodec *avcodec_find_decoder(enum CodecID id)
1032 { 1066 {
1033 AVCodec *p; 1067 AVCodec *p;
1034 p = first_avcodec; 1068 p = first_avcodec;
1035 while (p) { 1069 while (p) {
1038 p = p->next; 1072 p = p->next;
1039 } 1073 }
1040 return NULL; 1074 return NULL;
1041 } 1075 }
1042 1076
1077 /**
1078 * Find an decoder with the specified name.
1079 *
1080 * @param name Name of the requested decoder.
1081 * @return An decoder if one was found, NULL otherwise.
1082 */
1043 AVCodec *avcodec_find_decoder_by_name(const char *name) 1083 AVCodec *avcodec_find_decoder_by_name(const char *name)
1044 { 1084 {
1045 AVCodec *p; 1085 AVCodec *p;
1046 p = first_avcodec; 1086 p = first_avcodec;
1047 while (p) { 1087 while (p) {