MobileFFprobe.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2020 Taner Sener
  3. *
  4. * This file is part of MobileFFmpeg.
  5. *
  6. * MobileFFmpeg is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * MobileFFmpeg 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. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with MobileFFmpeg. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <string.h>
  20. #include <stdlib.h>
  21. #include <Foundation/Foundation.h>
  22. #include "MediaInformationParser.h"
  23. /**
  24. * Main class for FFprobe operations.
  25. */
  26. @interface MobileFFprobe : NSObject
  27. /**
  28. * Synchronously executes FFprobe with arguments provided.
  29. *
  30. * @param arguments FFprobe command options/arguments as string array
  31. * @return zero on successful execution, 255 on user cancel and non-zero on error
  32. */
  33. + (int)executeWithArguments:(NSArray*)arguments;
  34. /**
  35. * Synchronously executes FFprobe command provided. Space character is used to split command
  36. * into arguments.
  37. *
  38. * @param command FFprobe command
  39. * @return zero on successful execution, 255 on user cancel and non-zero on error
  40. */
  41. + (int)execute:(NSString*)command;
  42. /**
  43. * Returns media information for the given file.
  44. *
  45. * This method does not support executing multiple concurrent operations. If you execute
  46. * multiple operations (execute or getMediaInformation) at the same time, the response of this
  47. * method is not predictable.
  48. *
  49. * @param path or uri of media file
  50. * @return media information
  51. */
  52. + (MediaInformation*)getMediaInformation:(NSString*)path;
  53. /**
  54. * Returns media information for the given command.
  55. *
  56. * This method does not support executing multiple concurrent operations. If you execute
  57. * multiple operations (execute or getMediaInformation) at the same time, the response of this
  58. * method is not predictable.
  59. *
  60. * @param command ffprobe command
  61. * @return media information
  62. */
  63. + (MediaInformation*)getMediaInformationFromCommand:(NSString*)command;
  64. /**
  65. * Returns media information for given file.
  66. *
  67. * This method does not support executing multiple concurrent operations. If you execute
  68. * multiple operations (execute or getMediaInformation) at the same time, the response of this
  69. * method is not predictable.
  70. *
  71. * @param path path or uri of media file
  72. * @param timeout complete timeout
  73. * @deprecated this method is deprecated since v4.3.1. You can still use this method but
  74. * timeout parameter is not effective anymore.
  75. * @return media information
  76. */
  77. + (MediaInformation*)getMediaInformation:(NSString*)path timeout:(long)timeout __attribute__((deprecated));
  78. @end