File: alloctask.c

package info (click to toggle)
mjpegtools 1%3A2.1.0%2Bdebian-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 8,876 kB
  • ctags: 8,239
  • sloc: ansic: 60,401; cpp: 32,321; sh: 13,910; makefile: 785; python: 291; asm: 103
file content (50 lines) | stat: -rw-r--r-- 1,422 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 *  Copyright (C) 2001 Kawamata/Hitoshi <hitoshi.kawamata@nifty.ne.jp>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include "yuvfilters.h"

YfTaskCore_t *
YfAllocateTask(const YfTaskClass_t *filter, size_t size, const YfTaskCore_t *h0)
{
  YfTaskCore_t *h = malloc(size);
  if (!h) {
    perror("malloc");
    return NULL;
  }
  memset(h, 0, size);
  h->method = filter;
  h->handle_outgoing = NULL;
  y4m_init_stream_info(&h->si);
  if (h0) {
    y4m_copy_stream_info(&h->si, &h0->si);
    h->width   = h0->width;
    h->height  = h0->height;
    h->fpscode = h0->fpscode;
  }
  return h;
}

void
YfFreeTask(YfTaskCore_t *handle)
{
  y4m_fini_stream_info(&handle->si);
  free(handle);
}