en50221_app_utils.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. en50221 encoder An implementation for libdvb
  3. an implementation for the en50221 transport layer
  4. Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
  5. Copyright (C) 2005 Julian Scheel (julian at jusst dot de)
  6. Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
  7. This library is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU Lesser General Public License as
  9. published by the Free Software Foundation; either version 2.1 of
  10. the License, or (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with this library; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #include "en50221_app_utils.h"
  20. struct en50221_app_public_resource_id
  21. *en50221_app_decode_public_resource_id(struct en50221_app_public_resource_id *idf,
  22. uint32_t resource_id)
  23. {
  24. // reject private resources
  25. if ((resource_id & 0xc0000000) == 0xc0000000)
  26. return NULL;
  27. idf->resource_class = (resource_id >> 16) & 0xffff; // use the resource_id as the MSBs of class
  28. idf->resource_type = (resource_id >> 6) & 0x3ff;
  29. idf->resource_version = resource_id & 0x3f;
  30. return idf;
  31. }