Media types is a bundle for media entities.

You can add a new media type via the media_type_save() function.

  $type = new StdClass();
  $type->name = 'mymediatype';
  $type->label = 'My Media Type';
  $type->base = TRUE; // @todo what?
  $type->type_callback_args = array(
    'match_type' => 'all', // @todo what?
    'mimetypes' => array(),  // An array of regex patterns e.g. /^audio/
    'extensions' => array(), // An array of extensions
    'streams' => array() // An array of streams @todo what?
  );

  $type = media_type_save($type);