示例#1
0
static av_cold int decode_init(AVCodecContext *avctx)
{
    DSDContext * s;
    int i;

    init_static_data();

    s = av_malloc_array(sizeof(DSDContext), avctx->channels);
    if (!s)
        return AVERROR(ENOMEM);

    for (i = 0; i < avctx->channels; i++) {
        s[i].pos = 0;
        memset(s[i].buf, 0x69, sizeof(s[i].buf));

        /* 0x69 = 01101001
         * This pattern "on repeat" makes a low energy 352.8 kHz tone
         * and a high energy 1.0584 MHz tone which should be filtered
         * out completely by any playback system --> silence
         */
    }

    avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
    avctx->priv_data  = s;
    return 0;
}
示例#2
0
/* Called the first time stage->run() is invoked.
 */
static GLboolean
alloc_fog_data(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
{
   TNLcontext *tnl = TNL_CONTEXT(ctx);
   struct fog_stage_data *store;
   stage->privatePtr = malloc(sizeof(*store));
   store = FOG_STAGE_DATA(stage);
   if (!store)
      return GL_FALSE;

   _mesa_vector4f_alloc( &store->fogcoord, 0, tnl->vb.Size, 32 );

   if (!inited)
      init_static_data();

   return GL_TRUE;
}
示例#3
0
/* Called the first time stage->run() is invoked.
 */
static GLboolean alloc_fog_data( GLcontext *ctx,
				 struct gl_pipeline_stage *stage )
{
   TNLcontext *tnl = TNL_CONTEXT(ctx);
   struct fog_stage_data *store;
   stage->privatePtr = MALLOC(sizeof(*store));
   store = FOG_STAGE_DATA(stage);
   if (!store)
      return GL_FALSE;

   _mesa_vector1f_alloc( &store->fogcoord, 0, tnl->vb.Size, 32 );
   _mesa_vector1f_init( &store->input, 0, 0 );

   if (!inited)
      init_static_data();

   /* Now run the stage.
    */
   stage->run = run_fog_stage;
   return stage->run( ctx, stage );
}