You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2020/01/27 02:30:03 UTC

[GitHub] [guacamole-server] mike-jumper commented on a change in pull request #159: GUACAMOLE-465: beginning to support new codecs and containers

mike-jumper commented on a change in pull request #159: GUACAMOLE-465: beginning to support new codecs and containers
URL: https://github.com/apache/guacamole-server/pull/159#discussion_r371048700
 
 

 ##########
 File path: src/guacenc/ffmpeg-compat.h
 ##########
 @@ -78,5 +78,70 @@
  */
 int guacenc_avcodec_encode_video(guacenc_video* video, AVFrame* frame);
 
+/**
+ * Creates and sets up the AVCodecContext for the appropriate version
+ * of libavformat installed
+ *
+ * @param stream
+ *     The open AVStream
+ *
+ * @param codec
+ *     The codec used on the AVStream
+ *
+ * @param bitrate
+ *     The target bitrate for the encoded video
+ *
+ * @param width
+ *     The target width for the encoded video
+ *
+ * @param height
+ *     The target width for the encoded video
+ *
+ * @param gop_size
+ *     The size of the Group of Pictures
+ *
+ * @param qmax
+ *     The max value of the quantizer
+ *
+ * @param qmin
+ *     The min value of the quantizer
+ *
+ * @param pix_fmt
+ *     The target pixel format for the encoded video
+ *
+ * @param time_base
+ *     The target time base for the encoded video
+ *
+ */
+AVCodecContext* guacenc_build_avcodeccontext(AVStream* stream, AVCodec* codec,
+        int bitrate, int width, int height, int gop_size, int qmax, int qmin,
+        int pix_fmt, AVRational time_base);
+
+/**
+ * A wrapper for avcodec_open2(). Because libavformat ver
+ * 57.33.100 and greater use stream->codecpar rather than
+ * stream->codec to handle information to the codec,
+ * there needs to be an additional step in that version.
+ * So this wrapper handles that. Otherwise, it's the
+ * same as avcodec_open2().
+ *
+ * @param avcodec_context The context to initialize.
+ * @param codec The codec to open this context for. If a non-NULL codec has
+ *              been previously passed to avcodec_alloc_context3() or
+ *              for this context, then this parameter MUST be either NULL or
+ *              equal to the previously passed codec.
+ * @param options A dictionary filled with AVCodecContext and codec-private
+ *                options. On return this object will be filled with options
+ *                that were not found.
+ * @param stream The stream for the codec context.
+ *               Only used in libavformat >= 57.33.100. Can be NULL in
+ *               lower versions
+ *
+ * @return zero on success, a negative value on error
+ */
 
 Review comment:
   Please use the same comment style as the other recent functions within guacamole-server (the style you aimed at already with `guacenc_build_avcodeccontext()`). The descriptions of the accepted parameters should start on the next line following the `@param` line, indented by one level, with a blank line between each parameter description.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services