001/*******************************************************************************
002 * Copyright (c) 2024, 2026, Olivier Ayache.  All rights reserved.
003 *
004 * This file is part of AVPKit.
005 *
006 * AVPKit is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Lesser General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * AVPKit is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with AVPKit.  If not, see <http://www.gnu.org/licenses/>.
018 *******************************************************************************/
019
020package com.avpkit.core.io;
021
022import com.avpkit.core.io.IURLProtocolHandler;
023
024/**
025 * Used by URLProtocolManager to get a factory for a given protocol.
026 * 
027 * Implement this interface on any factories that make your
028 * specific implementation of IURLProtocolHandler, and then
029 * register the factory with your URLProtocolManager
030 */
031public interface IURLProtocolHandlerFactory
032{
033  /**
034   * Called by FFMPEG in order to get a handler to use for a given file.
035   * 
036   * @param url The URL that FFMPEG is trying to open.
037   * @param flags The flags that FFMPEG will pass to {@link IURLProtocolHandler#open(String, int)}
038   * @return A {@link IURLProtocolHandler} to use, or null.  If null, a file not found error will be passed back
039   *   to FFMPEG.
040   */
041  public IURLProtocolHandler getHandler(String url,
042      int flags);
043}