• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavcodec/

Lines Matching refs:avctx

73 static av_cold int decode_init(AVCodecContext *avctx)
75 AnsiContext *s = avctx->priv_data;
76 avctx->pix_fmt = PIX_FMT_PAL8;
84 if (!avctx->width || !avctx->height)
85 avcodec_set_dimensions(avctx, 80<<3, 25<<4);
90 static void hscroll(AVCodecContext *avctx)
92 AnsiContext *s = avctx->priv_data;
95 if (s->y < avctx->height - s->font_height) {
101 for (; i < avctx->height - s->font_height; i++)
104 avctx->width);
105 for (; i < avctx->height; i++)
107 DEFAULT_BG_COLOR, avctx->width);
110 static void erase_line(AVCodecContext * avctx, int xoffset, int xlength)
112 AnsiContext *s = avctx->priv_data;
119 static void erase_screen(AVCodecContext *avctx)
121 AnsiContext *s = avctx->priv_data;
123 for (i = 0; i < avctx->height; i++)
124 memset(s->frame.data[0] + i * s->frame.linesize[0], DEFAULT_BG_COLOR, avctx->width);
131 static void draw_char(AVCodecContext *avctx, int c)
133 AnsiContext *s = avctx->priv_data;
148 if (s->x >= avctx->width) {
150 hscroll(avctx);
158 static int execute_code(AVCodecContext * avctx, int c)
160 AnsiContext *s = avctx->priv_data;
167 s->y = FFMIN(s->y + (s->nb_args > 0 ? s->args[0]*s->font_height : s->font_height), avctx->height - s->font_height);
170 s->x = FFMIN(s->x + (s->nb_args > 0 ? s->args[0]*FONT_WIDTH : FONT_WIDTH), avctx->width - FONT_WIDTH);
177 s->y = s->nb_args > 0 ? av_clip((s->args[0] - 1)*s->font_height, 0, avctx->height - s->font_height) : 0;
178 s->x = s->nb_args > 1 ? av_clip((s->args[1] - 1)*FONT_WIDTH, 0, avctx->width - FONT_WIDTH) : 0;
218 av_log_ask_for_sample(avctx, "unsupported screen mode\n");
220 if (width != avctx->width || height != avctx->height) {
222 avctx->release_buffer(avctx, &s->frame);
223 avcodec_set_dimensions(avctx, width, height);
224 ret = avctx->get_buffer(avctx, &s->frame);
226 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
232 erase_screen(avctx);
234 erase_screen(avctx);
240 erase_line(avctx, s->x, avctx->width - s->x);
241 if (s->y < avctx->height - s->font_height)
243 DEFAULT_BG_COLOR, (avctx->height - s->y - s->font_height)*s->frame.linesize[0]);
246 erase_line(avctx, 0, s->x);
251 erase_screen(avctx);
257 erase_line(avctx, s->x, avctx->width - s->x);
260 erase_line(avctx, 0, s->x);
263 erase_line(avctx, 0, avctx->width);
288 av_log_ask_for_sample(avctx, "unsupported rendition parameter\n");
301 s->x = av_clip(s->sx, 0, avctx->width - FONT_WIDTH);
302 s->y = av_clip(s->sy, 0, avctx->height - s->font_height);
305 av_log_ask_for_sample(avctx, "unsupported escape code\n");
311 static int decode_frame(AVCodecContext *avctx,
315 AnsiContext *s = avctx->priv_data;
321 ret = avctx->reget_buffer(avctx, &s->frame);
323 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
346 draw_char(avctx, ' ');
349 hscroll(avctx);
354 erase_screen(avctx);
360 draw_char(avctx, buf[0]);
370 draw_char(avctx, 0x1B);
395 av_log(avctx, AV_LOG_WARNING, "args overflow (%i)\n", s->nb_args);
398 if (execute_code(avctx, buf[0]) < 0)
417 static av_cold int decode_close(AVCodecContext *avctx)
419 AnsiContext *s = avctx->priv_data;
421 avctx->release_buffer(avctx, &s->frame);